#50559 [Opn->Asn]: Clone is not implemented for DateInterval and DatePeriod

From: Date: Wed, 23 Dec 2009 12:24:13 +0000
Subject: #50559 [Opn->Asn]: Clone is not implemented for DateInterval and DatePeriod
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-146058@lists.php.net to get a copy of this message
ID: 50559 Updated by: derick@php.net Reported By: sr at emini dot dk -Status: Open +Status: Assigned Bug Type: Date/time related Operating System: Fedora 10 PHP Version: 5.3.1 -Assigned To: +Assigned To: derick Previous Comments: ------------------------------------------------------------------------ [2009-12-23 12:04:54] sr at emini dot dk 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 this bug report at http://bugs.php.net/?id=50559&edit=1

« previous php.bugs (#146058) next »