From:             fsb at thefsb dot org
Operating system: Mac 10.5.5
PHP version:      5.2.6
PHP Bug Type:     Date/time related
Bug description:  Inconsistent return values for strtotime('0000-00-00')

Description:
------------
strtotime('0000-00-00') returns int(-62169955200) in a script run by 
apache web server and bool(false) when run by the command line.




Reproduce code:
---------------
<?php
var_dump(strtotime('0000-00-00'));
?>
this script outputs int(-62169955200) to the web browser when run as a web
page and bool(false) when run on the command line.

Expected result:
----------------
i would expect the same result from running the function in the two 
contexts. 

regarding which result strtotime('0000-00-00') should return, i don't 
know. both answers seem reasonable to me. it would help if php 
documentation would specify the range of dates and unix timestamps that 
date and time functions can handle.

Actual result:
--------------
int(-62169955200) in the web page
bool(false) in the command line




-- 
Edit bug report at http://bugs.php.net/?id=46597&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        
http://bugs.php.net/fix.php?id=46597&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        
http://bugs.php.net/fix.php?id=46597&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        
http://bugs.php.net/fix.php?id=46597&r=trysnapshot60
Fixed in CVS:                        
http://bugs.php.net/fix.php?id=46597&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=46597&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=46597&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=46597&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=46597&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=46597&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=46597&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=46597&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=46597&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=46597&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=46597&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=46597&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=46597&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=46597&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=46597&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=46597&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=46597&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=46597&r=mysqlcfg

Reply via email to