#36885 [NoF->Opn]: __clone() does not work when defined for class extending arrayObject
| From: | lta at lfdj dot com | Date: | Wed, 03 May 2006 08:49:55 +0000 |
| Subject: | #36885 [NoF->Opn]: __clone() does not work when defined for class extending arrayObject | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-96517@lists.php.net to get a copy of this message | ||
ID: 36885
User updated by: lta at lfdj dot com
Reported By: lta at lfdj dot com
-Status: No Feedback
+Status: Open
Bug Type: SPL related
Operating System: solaris
PHP Version: 5.1.2
Assigned To: helly
New Comment:
Sorry for late feedback.
Bug is fixed with this snaps
http://snaps.php.net/win32/php5.1-win32-200605030630.zip
Previous Comments:
------------------------------------------------------------------------
[2006-04-19 01:00:00] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2006-04-11 18:47:45] helly@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.1-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.1-win32-latest.zip
------------------------------------------------------------------------
[2006-04-11 11:26:19] sniper@php.net
Assigned to the SPL maintainer.
------------------------------------------------------------------------
[2006-03-28 10:34:31] lta at lfdj dot com
Forget to put run code...
This is to insert after test class definition.
$original = new test;
$original->append(new bidon());
$original->append(new bidon());
$cloned2 = clone $original;
------------------------------------------------------------------------
[2006-03-28 10:28:10] tony2001@php.net
I don't see any problems:
<?php
class test extends ArrayObject {
public $pub = 1;
public function __clone() {
$this->pub = "cloned";
}
}
$a = new test;
$b = clone $a;
var_dump($a->pub);
var_dump($b->pub);
?>
int(1)
string(6) "cloned"
Did you even try to run your code?
I doesn't work at all as you didn't instanciate the objects.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/36885
--
Edit this bug report at http://bugs.php.net/?id=36885&edit=1