#40269 [NEW]: date_parse handles 0000-00-00 as 2000-00-00
From: cleo at anarki dot dk
Operating system: WindowsXP
PHP version: 5.2.0
PHP Bug Type: Feature/Change Request
Bug description: date_parse handles 0000-00-00 as 2000-00-00
Description:
------------
MySQL uses the questionable format '0000-00-00' for a date that has not
been set. A kind of null value for at date.
I fed this date into date_parse(), and got rather an unexpected result: It
returns year 2000.
Reproduce code:
---------------
$d= '0000-00-00';
print_r (date_parse($d)) ;
Expected result:
----------------
Array ( [year] => 0000 [month] => 0 [day] => 0 ...
or false or null or an error of some kind.
Actual result:
--------------
Array ( [year] => 2000 [month] => 0 [day] => 0 ...
--
Edit bug report at http://bugs.php.net/?id=40269&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=40269&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=40269&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=40269&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=40269&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=40269&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=40269&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=40269&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=40269&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=40269&r=support
Expected behavior: http://bugs.php.net/fix.php?id=40269&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=40269&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=40269&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=40269&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=40269&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=40269&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=40269&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=40269&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=40269&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=40269&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=40269&r=mysqlcfg
Thread (2 messages)
- cleo at anarki dot dk