From: Operating system: Mac OS X 10.7.2 (Lion) PHP version: 5.4SVN-2011-12-19 (snap) Package: Apache2 related Bug Type: Bug Bug description:$_SERVER['REQUEST_TIME'] is now a float but lacks a digit in Apache2 SAPI
Description: ------------ As of PHP 5.4, $_SERVER['REQUEST_TIME'] is no longer an int, but a float. However, using Apache 2 SAPI, this server variable only have 3 decimal digits. This make DateTime::__construct() throw an exception : Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (@1324314320.916) at position 12 (9): Unexpected character' in /Users/lolautruche/workspace/test.php on line 3 As a comparison, FPM and built-in server defines 4 decimal digits, which is valid. This might affect Apache 1 SAPI as well. This also might be related to #55733 Test script: --------------- <?php var_dump( $_SERVER['REQUEST_TIME'] ); // Displays a float with 3 decimal digits with Apache2, 4 with FPM/built-in server $date = new DateTime( '@' . $_SERVER['REQUEST_TIME'] ); var_dump( $date ); Expected result: ---------------- $_SERVER['REQUEST_TIME'] should always have 4 decimal digits. -- Edit bug report at https://bugs.php.net/bug.php?id=60565&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60565&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60565&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60565&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=60565&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60565&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=60565&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=60565&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=60565&r=needscript Try newer version: https://bugs.php.net/fix.php?id=60565&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=60565&r=support Expected behavior: https://bugs.php.net/fix.php?id=60565&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=60565&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=60565&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=60565&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60565&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=60565&r=dst IIS Stability: https://bugs.php.net/fix.php?id=60565&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=60565&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=60565&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=60565&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=60565&r=mysqlcfg