#34767 [Com]: Zend Engine 1 Compatibility not copying objects correctly
| From: | jason at jasonjustman dot com | Date: | Mon, 10 Oct 2005 20:05:50 +0000 |
| Subject: | #34767 [Com]: Zend Engine 1 Compatibility not copying objects correctly | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-86365@lists.php.net to get a copy of this message | ||
ID: 34767
Comment by: jason at jasonjustman dot com
Reported By: dstarr at allofe dot net
Status: Assigned
Bug Type: Scripting Engine problem
Operating System: *
PHP Version: 5CVS-2005-10-06 (cvs)
Assigned To: dmitry
New Comment:
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
Previous Comments:
------------------------------------------------------------------------
[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