note 116225 added to datetime.construct
| From: | rn at alpha9marketing dot com | Date: | Tue, 25 Nov 2014 12:48:00 +0000 |
| Subject: | note 116225 added to datetime.construct | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-201017@lists.php.net to get a copy of this message | ||
Note that the DateTime ctor also accepts boolean false and empty strings, and treats them the same
as NULL (i.e. result is current date and time). This may lead to unexpected results if you forward
function return values without explicitly checking them first.
Empty arrays and boolean true trigger PHP warnings OTOH.
(checked with PHP 5.5.18)
----
Server IP: 72.52.91.14
Probable Submitter: 195.14.234.228
----
Manual Page -- http://php.net/manual/en/datetime.construct.php
Edit -- https://master.php.net/note/edit/116225
Del: integrated -- https://master.php.net/note/delete/116225/integrated
Del: useless -- https://master.php.net/note/delete/116225/useless
Del: bad code -- https://master.php.net/note/delete/116225/bad+code
Del: spam -- https://master.php.net/note/delete/116225/spam
Del: non-english -- https://master.php.net/note/delete/116225/non-english
Del: in docs -- https://master.php.net/note/delete/116225/in+docs
Del: other reasons-- https://master.php.net/note/delete/116225
Reject -- https://master.php.net/note/reject/116225
Search -- https://master.php.net/manage/user-notes.php