php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33243 ze1_compatibility_mode does not work as expected
Submitted: 2005-06-04 20:12 UTC Modified: 2005-06-07 09:04 UTC
From: ladislav dot prosek at matfyz dot cz Assigned: dmitry (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5.* (2005-06-07) OS: *
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ladislav dot prosek at matfyz dot cz
New email:
PHP Version: OS:

 

 [2005-06-04 20:12 UTC] ladislav dot prosek at matfyz dot cz
Description:
------------
When zend.ze1_compatibility_mode is On, object copying is not compliant to PHP4. Namely, objects are not deep-copied on assignment. This may cause substantial problems to legacy applications that rely on the compatibility mode.

Reproduce code:
---------------
$a->y->z = 0;
$b = $a;      // should perform deep copy of $a
$b->y->z = 1; // hence this should have no effect on $a
var_dump($a);


Expected result:
----------------
object(stdClass)#1 (1) {
  ["y"]=>
  object(stdClass)#2 (1) {
    ["z"]=>
    int(0) // <--
  }
}


Actual result:
--------------
object(stdClass)#1 (1) {
  ["y"]=>
  object(stdClass)#2 (1) {
    ["z"]=>
    int(1) // because $a->y and $b->y are still one object after the assignment
  }
}


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-06-05 15:00 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.0-win32-latest.zip


 [2005-06-06 18:30 UTC] ladislav dot prosek at matfyz dot cz
Still the same. Only the top-level object is cloned.
 [2005-06-06 23:59 UTC] sniper@php.net
Dmitry, can you check this one out too? (I thought something like this was fixed already but apparently not)

 [2005-06-07 09:04 UTC] dmitry@php.net
Fixed in CVS HEAD and PHP_5_0.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 12:01:29 2024 UTC