php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34767 Zend Engine 1 Compatibility not copying objects correctly
Submitted: 2005-10-06 20:49 UTC Modified: 2005-10-20 10:16 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: dstarr at allofe dot net Assigned: dmitry
Status: Closed Package: Scripting Engine problem
PHP Version: 5CVS-2005-10-06 (cvs) OS: *
Private report: No CVE-ID:
 [2005-10-06 20:49 UTC] 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 ( ) ) 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-10-06 20:55 UTC] 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:56 UTC] sniper@php.net
The expected result you do get without setting the option..so.. :)

 [2005-10-10 22:05 UTC] 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-20 10:16 UTC] dmitry@php.net
Fixed in CVS HEAD and PHP_5_1.
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Thu Apr 24 19:01:53 2014 UTC