From: sr at emini dot dk Operating system: Fedora 10 PHP version: 5.3.1 PHP Bug Type: Date/time related Bug description: Clone is not implemented for DateInterval and DatePeriod
Description: ------------ I am unable to clone an object of type DateInterval or DatePeriod. The clone appears to be an empty object. I've looked in the source and the code to clone the objects seem to be missing from both date_object_clone_interval() and date_object_clone_period(). Reproduce code: --------------- $dateInterval1 = new \DateInterval('P1D'); $dateInterval2 = clone $dateInterval; var_dump($dateInterval1); var_dump($dateInterval2); Expected result: ---------------- $dateInterval2 should be a clone of $dateInterval1. Actual result: -------------- $dateInterval1 works as expected, but $dateInterval2 appears to be an empty object. -- Edit bug report at http://bugs.php.net/?id=50559&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=50559&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=50559&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=50559&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=50559&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=50559&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=50559&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=50559&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=50559&r=needscript Try newer version: http://bugs.php.net/fix.php?id=50559&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=50559&r=support Expected behavior: http://bugs.php.net/fix.php?id=50559&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=50559&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=50559&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=50559&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50559&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=50559&r=dst IIS Stability: http://bugs.php.net/fix.php?id=50559&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=50559&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=50559&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=50559&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=50559&r=mysqlcfg