#34767 [Asn->Csd]: Zend Engine 1 Compatibility not copying objects correctly
| From: | dmitry@php.net | Date: | Thu, 20 Oct 2005 08:16:03 +0000 |
| Subject: | #34767 [Asn->Csd]: Zend Engine 1 Compatibility not copying objects correctly | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-86785@lists.php.net to get a copy of this message | ||
ID: 34767
Updated by: dmitry@php.net
Reported By: dstarr at allofe dot net
-Status: Assigned
+Status: Closed
Bug Type: Scripting Engine problem
Operating System: *
PHP Version: 5CVS-2005-10-06 (cvs)
Assigned To: dmitry
New Comment:
Fixed in CVS HEAD and PHP_5_1.
Previous Comments:
------------------------------------------------------------------------
[2005-10-10 22:05:47] jason at jasonjustman dot com
if you're going to nuke ze1_compat then add the clone keyword into the
4.x branch (like i recommended A YEAR AGO:
http://bugs.php.net/bug.php?id=30332).
j
------------------------------------------------------------------------
[2005-10-06 20:56:31] sniper@php.net
The expected result you do get without setting the option..so.. :)
------------------------------------------------------------------------
[2005-10-06 20:55:38] sniper@php.net
Dmitry, this thing doesn't really seem to work.
Somehow I'm getting the impression that it would be much better to just
nuke this option and make people fix their scripts..
------------------------------------------------------------------------
[2005-10-06 20:49:00] dstarr at allofe dot net
Description:
------------
When zend.ze1_compatibility_mode is On, copying objects that have
references to other objects the object that was referenced is copied
instead of the reference itself.
The Expected Results were obtained by using PHP 4.4.0
The Actual is a result of running on 5.0.5
Reproduce code:
---------------
$a->y = &new stdClass();
print_r($a);
echo "<br/>";
$b = $a;
$a->y->z = 1;
print_r($b);
Expected result:
----------------
// Expected Output
// stdClass Object ( [y] => stdClass Object ( ) )
// stdClass Object ( [y] => stdClass Object ( [z] => 1 ) )
Actual result:
--------------
// Actual Output
// stdClass Object ( [y] => stdClass Object ( ) )
// stdClass Object ( [y] => stdClass Object ( ) )
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=34767&edit=1