<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Whether another calendar is equal but for a different time</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="intlcalendar.indaylighttime.html">IntlCalendar::inDaylightTime</a></div> <div class="next" style="text-align: right; float: right;"><a href="intlcalendar.islenient.html">IntlCalendar::isLenient</a></div> <div class="up"><a href="class.intlcalendar.html">IntlCalendar</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="intlcalendar.isequivalentto" class="refentry"> <div class="refnamediv"> <h1 class="refname">IntlCalendar::isEquivalentTo</h1> <p class="verinfo">(PHP 5.5.0, PECL >= 3.0.0a1)</p><p class="refpurpose"><span class="refname">IntlCalendar::isEquivalentTo</span> — <span class="dc-title">Whether another calendar is equal but for a different time</span></p> </div> <div class="refsect1 description" id="refsect1-intlcalendar.isequivalentto-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">bool</span> <span class="methodname"><strong>IntlCalendar::isEquivalentTo</strong></span> ( <span class="methodparam"><span class="type"><a href="class.intlcalendar.html" class="type IntlCalendar">IntlCalendar</a></span> <code class="parameter">$calendar</code></span> )</div> <p class="para rdfs-comment"> Returns whether this and the given object are equivalent for all purposes except as to the time they have set. The locales do not have to match, as long as no change in behavior results from such mismatch. This includes the <a href="intlcalendar.gettimezone.html" class="link">timezone</a>, whether the <a href="intlcalendar.islenient.html" class="link">lenient mode</a> is set, the <a href="intlcalendar.getrepeatedwalltimeoption.html" class="link">repeated</a> and <a href="intlcalendar.getskippedwalltimeoption.html" class="link">skipped</a> wall time settings, the <a href="intlcalendar.getdayofweektype.html" class="link">days of the week when the weekend starts and ceases</a> and the <a href="intlcalendar.getweekendtransition.html" class="link">times where such transitions occur</a>. It may also include other calendar specific settings, such as the Gregorian/Julian transition instant. </p> </div> <div class="refsect1 parameters" id="refsect1-intlcalendar.isequivalentto-parameters"> <h3 class="title">Parameters</h3> <dl> <dt> <span class="term"><em><code class="parameter">calendar</code></em></span> <dd> <p class="para"> The other calendar against which the comparison is to be made. </p> </dd> </dt> </dl> </div> <div class="refsect1 returnvalues" id="refsect1-intlcalendar.isequivalentto-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Assuming there are no argument errors, returns <strong><code>TRUE</code></strong> iif the calendars are equivalent except possibly for their set time. </p> </div> <div class="refsect1 examples" id="refsect1-intlcalendar.isequivalentto-examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example" id="example-2616"> <p><strong>Example #1 <span class="function"><strong>IntlCalendar::isEquivalentTo()</strong></span></strong></p> <div class="example-contents"> <div class="phpcode"><code><span style="color: #000000"> <span style="color: #0000BB"><?php<br />$cal1 </span><span style="color: #007700">= </span><span style="color: #0000BB">IntlCalendar</span><span style="color: #007700">::</span><span style="color: #0000BB">createInstance</span><span style="color: #007700">(</span><span style="color: #DD0000">'Europe/Lisbon'</span><span style="color: #007700">, </span><span style="color: #DD0000">'pt_PT'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$cal2 </span><span style="color: #007700">= </span><span style="color: #0000BB">IntlCalendar</span><span style="color: #007700">::</span><span style="color: #0000BB">createInstance</span><span style="color: #007700">(</span><span style="color: #DD0000">'Europe/Lisbon'</span><span style="color: #007700">, </span><span style="color: #DD0000">'es_ES'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$cal2</span><span style="color: #007700">-></span><span style="color: #0000BB">clear</span><span style="color: #007700">();<br /><br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$cal1</span><span style="color: #007700">-></span><span style="color: #0000BB">isEquivalentTo</span><span style="color: #007700">(</span><span style="color: #0000BB">$cal2</span><span style="color: #007700">)); </span><span style="color: #FF8000">// true<br /><br /></span><span style="color: #0000BB">$cal3 </span><span style="color: #007700">= </span><span style="color: #0000BB">IntlCalendar</span><span style="color: #007700">::</span><span style="color: #0000BB">createInstance</span><span style="color: #007700">(</span><span style="color: #DD0000">'Europe/Lisbon'</span><span style="color: #007700">, </span><span style="color: #DD0000">'en_US'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$cal1</span><span style="color: #007700">-></span><span style="color: #0000BB">isEquivalentTo</span><span style="color: #007700">(</span><span style="color: #0000BB">$cal3</span><span style="color: #007700">)); </span><span style="color: #FF8000">// false<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$cal1</span><span style="color: #007700">-></span><span style="color: #0000BB">getFirstDayOfWeek</span><span style="color: #007700">(), </span><span style="color: #FF8000">// 2 (Monday)<br /></span><span style="color: #0000BB">$cal3</span><span style="color: #007700">-></span><span style="color: #0000BB">getFirstDayOfWeek</span><span style="color: #007700">()); </span><span style="color: #FF8000">// 1 (Sunday)</span> </span> </code></div> </div> <div class="example-contents"><p>The above example will output:</p></div> <div class="example-contents screen"> <div class="cdata"><pre> bool(true) bool(false) int(2) int(1) </pre></div> </div> </div> </p> </div> <div class="refsect1 seealso" id="refsect1-intlcalendar.isequivalentto-seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"> <span class="methodname"><a href="intlcalendar.equals.html" class="methodname" rel="rdfs-seeAlso">IntlCalendar::equals()</a> - Compare time of two IntlCalendar objects for equality</span></li> </ul> </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="intlcalendar.indaylighttime.html">IntlCalendar::inDaylightTime</a></div> <div class="next" style="text-align: right; float: right;"><a href="intlcalendar.islenient.html">IntlCalendar::isLenient</a></div> <div class="up"><a href="class.intlcalendar.html">IntlCalendar</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>