Adjust example to show excessive values rolling into parents.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@298446 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Daniel Convissor 2010-04-24 20:15:59 +00:00
parent 3b5eab0c4e
commit c866af773f

View file

@ -90,8 +90,13 @@
<![CDATA[
<?php
$date = new DateTime();
$date->setDate(2022, 3, 4);
echo $date->format('Y-m-d');
$date->setDate(2001, 2, 3);
echo $date->format('Y-m-d') . "\n";
// Values exceeding ranges are added to their parent values.
$date->setDate(2001, 14, 3);
echo $date->format('Y-m-d') . "\n";
?>
]]>
</programlisting>
@ -102,15 +107,21 @@ echo $date->format('Y-m-d');
<![CDATA[
<?php
$date = date_create();
date_date_set($date, 2022, 3, 4);
echo date_format($date, 'Y-m-d');
date_date_set($date, 2001, 2, 3);
echo date_format($date, 'Y-m-d') . "\n";
// Values exceeding ranges are added to their parent values.
date_date_set($date, 2001, 14, 3);
echo date_format($date, 'Y-m-d') . "\n";
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
2022-03-04
2001-02-03
2002-02-03
]]>
</screen>
</example>