|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-04-09 18:06 UTC] requinix@php.net
-Status: Open
+Status: Not a bug
[2015-04-09 18:06 UTC] requinix@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 08 13:00:02 2026 UTC |
Description: ------------ When parsing strings containing only a year, it appears that certain ranges of years do not get parsed appropriately. This is a cause, at least in my case, of very difficult to debug errors. Test script: --------------- echo var_export(date_parse('1999'), true)."\n\n"; echo var_export(date_parse('2001'), true); Expected result: ---------------- array ( 'year' => 1999, 'month' => false, 'day' => false, 'hour' => false, 'minute' => false, 'second' => false, ... ) array ( 'year' => 2001, 'month' => false, 'day' => false, 'hour' => false, 'minute' => false, 'second' => false, ... ) Actual result: -------------- array ( 'year' => 1999, 'month' => false, 'day' => false, 'hour' => false, 'minute' => false, 'second' => false, ... ) array ( 'year' => false, 'month' => false, 'day' => false, 'hour' => 20, 'minute' => 1, 'second' => 0, ... )