#30332 [Opn->Asn]: zend.ze1_compatibility_mode isnt fully compatable with array_push()

From: Date: Wed, 06 Oct 2004 06:53:03 +0000
Subject: #30332 [Opn->Asn]: zend.ze1_compatibility_mode isnt fully compatable with array_push()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-67168@lists.php.net to get a copy of this message
ID: 30332 Updated by: derick@php.net Reported By: justmanj at msu dot edu -Status: Open +Status: Assigned Bug Type: Zend Engine 2 problem Operating System: winxp PHP Version: 5.0.2 -Assigned To: +Assigned To: andi Previous Comments: ------------------------------------------------------------------------ [2004-10-05 23:35:12] justmanj at msu dot edu Description: ------------ zend.ze1_compatibility_mode when turned on doesn't honor the same methodlogy as 4.x when passing a class for some parameters - it passes by reference in functions like array_push(); this behavior was not in 4.3.x, and the only workaround is the clone keyword, which should be added in the 4.3.x tree for backwards compatability. Reproduce code: --------------- <? class x { }; $first = new x; $second = $first; $container = array(); array_push($container, $first); $first->first = " im in the first"; print_r($first); print_r($second); print_r($container); Expected result: ---------------- x Object ( [first] => im in the first ) x Object ( ) Array ( [0] => x Object ( ) ) Actual result: -------------- x Object ( [first] => im in the first ) x Object ( ) Array ( [0] => x Object ( [first] => im in the first ) ) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=30332&edit=1

« previous php.bugs (#67168) next »