note 116480 added to datetime.construct

From: Date: Fri, 09 Jan 2015 11:38:34 +0000
Subject: note 116480 added to datetime.construct
Groups: php.notes 
Request: Send a blank email to php-notes+get-201393@lists.php.net to get a copy of this message
If time cannot be parsed an exception of type Exception is thrown which can be caught, however an E_WARNING is emitted as well. This might be confusing if you are converting warnings to exceptions in your error or shutdown handler. <?php try { $var = new DateTime('some invalid date format'); } catch (Exception $ex) {} $warning = error_get_last(); // will contain warning info ?> ---- Server IP: 72.52.91.14 Probable Submitter: 85.94.80.51 ---- Manual Page -- http://php.net/manual/en/datetime.construct.php Edit -- https://master.php.net/note/edit/116480 Del: integrated -- https://master.php.net/note/delete/116480/integrated Del: useless -- https://master.php.net/note/delete/116480/useless Del: bad code -- https://master.php.net/note/delete/116480/bad+code Del: spam -- https://master.php.net/note/delete/116480/spam Del: non-english -- https://master.php.net/note/delete/116480/non-english Del: in docs -- https://master.php.net/note/delete/116480/in+docs Del: other reasons-- https://master.php.net/note/delete/116480 Reject -- https://master.php.net/note/reject/116480 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#201393) next »