From: Operating system: PHP version: 5.3.2 Package: Date/time related Bug Type: Bug Bug description:new DateTime(time()) failed and should not
Description: ------------ Creating a new DateTime object with a unix timestamp failed with error Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1279547855) at position 8 (5): Unexpected character' If this is expected behaviour, this should be written in documentation and DateTime::setTimestamp() should be fixed: http://www.php.net/manual/en/datetime.settimestamp.php#Notes "Passing a Unix timestamp to DateTime::__construct() is an alternative when using PHP 5.2." Test script: --------------- <?php var_dump(new DateTime(time())); Expected result: ---------------- no fatal error :) Actual result: -------------- Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1279547855) at position 8 (5): Unexpected character' -- Edit bug report at http://bugs.php.net/bug.php?id=52378&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=52378&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=52378&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=52378&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=52378&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=52378&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=52378&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=52378&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=52378&r=needscript Try newer version: http://bugs.php.net/fix.php?id=52378&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=52378&r=support Expected behavior: http://bugs.php.net/fix.php?id=52378&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=52378&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=52378&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=52378&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=52378&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=52378&r=dst IIS Stability: http://bugs.php.net/fix.php?id=52378&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=52378&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=52378&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=52378&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=52378&r=mysqlcfg
