note 113342 added to datetime.construct
| From: | RussellG | Date: | Sun, 29 Sep 2013 16:08:28 +0000 |
| Subject: | note 113342 added to datetime.construct | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-196415@lists.php.net to get a copy of this message | ||
Although this function throws an exception on invalid $time values (empty strings, for example), the
exception can't be caught because it's a fatal exception. Use functions such as
checkdate() and strtotime() to validate the string first. Example #1 should be changed to remove the
try/catch block, since it's misleading.
----
Server IP: 64.71.164.2
Probable Submitter: 76.187.238.71
----
Manual Page -- http://php.net/manual/en/datetime.construct.php
Edit -- https://master.php.net/note/edit/113342
Del: integrated -- https://master.php.net/note/delete/113342/integrated
Del: useless -- https://master.php.net/note/delete/113342/useless
Del: bad code -- https://master.php.net/note/delete/113342/bad+code
Del: spam -- https://master.php.net/note/delete/113342/spam
Del: non-english -- https://master.php.net/note/delete/113342/non-english
Del: in docs -- https://master.php.net/note/delete/113342/in+docs
Del: other reasons-- https://master.php.net/note/delete/113342
Reject -- https://master.php.net/note/reject/113342
Search -- https://master.php.net/manage/user-notes.php