note 118621 added to function.date
| From: | Anonymous | Date: | Sun, 10 Jan 2016 14:04:51 +0000 |
| Subject: | note 118621 added to function.date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-204634@lists.php.net to get a copy of this message | ||
If timestamp is a string, date converts it to an integer in a possibly unexpected way:
<?php
echo (int)'0x10'; //0
echo intval('0x10'); //0
echo date('s', '0x10'); //gives 16
//however, no octal conversion:
echo date('s', '010'); //gives 10
?>
(PHP 5.6.16)
----
Server IP: 72.52.91.14
Probable Submitter: 2a02:810b:893f:ec40:a938:5e41:90c6:5f7a
----
Manual Page -- http://php.net/manual/en/function.date.php
Edit -- https://master.php.net/note/edit/118621
Del: integrated -- https://master.php.net/note/delete/118621/integrated
Del: useless -- https://master.php.net/note/delete/118621/useless
Del: bad code -- https://master.php.net/note/delete/118621/bad+code
Del: spam -- https://master.php.net/note/delete/118621/spam
Del: non-english -- https://master.php.net/note/delete/118621/non-english
Del: in docs -- https://master.php.net/note/delete/118621/in+docs
Del: other reasons-- https://master.php.net/note/delete/118621
Reject -- https://master.php.net/note/reject/118621
Search -- https://master.php.net/manage/user-notes.php