|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-03-29 18:13 UTC] cmb@php.net
-Status: Open
+Status: Verified
[2021-04-05 16:21 UTC] derick@php.net
-Status: Verified
+Status: Not a bug
[2021-04-05 16:21 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 14 19:00:01 2025 UTC |
Description: ------------ the strtotime() function accepts a string with one or more spaces (' '), one or more dots ('.') or one or more comma's (',') or a combination of these with no other valid date/time information as acceptable and returns a timestamp (now) instead of the expected FALSE. Here is the output on a bunch of different PHP versions -> https://3v4l.org/kSH46 Test script: --------------- <?php var_dump(strtotime(" ")); var_dump(strtotime(",")); var_dump(strtotime(".")); var_dump(strtotime(". .. .. .. .... .. . .. .")); var_dump(strtotime(". .. .. .. ..,,,.. .. . .. .")); var_dump(strtotime("bogus")); Expected result: ---------------- boolean false boolean false boolean false boolean false boolean false boolean false Actual result: -------------- int 1443016200 int 1443016200 int 1443016200 int 1443016200 int 1443016200 boolean false