cvs: ZendEngine2 / zend_execute_API.c /tests bug34767.phpt

From: Date: Thu, 20 Oct 2005 08:15:13 +0000
Subject: cvs: ZendEngine2 / zend_execute_API.c /tests bug34767.phpt
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-4263@lists.php.net to get a copy of this message
dmitry Thu Oct 20 04:15:13 2005 EDT Modified files: /ZendEngine2 zend_execute_API.c /ZendEngine2/tests bug34767.phpt Log: Fixed bug #34767 (Zend Engine 1 Compatibility not copying objects correctly) http://cvs.php.net/diff.php/ZendEngine2/zend_execute_API.c?r1=1.341&r2=1.342&ty=u Index: ZendEngine2/zend_execute_API.c diff -u ZendEngine2/zend_execute_API.c:1.341 ZendEngine2/zend_execute_API.c:1.342 --- ZendEngine2/zend_execute_API.c:1.341 Thu Sep 8 07:10:28 2005 +++ ZendEngine2/zend_execute_API.c Thu Oct 20 04:15:12 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_execute_API.c,v 1.341 2005/09/08 11:10:28 dmitry Exp $ */ +/* $Id: zend_execute_API.c,v 1.342 2005/10/20 08:15:12 dmitry Exp $ */ #include <stdio.h> #include <signal.h> @@ -396,6 +396,13 @@ zval_dtor(*zval_ptr); safe_free_zval_ptr_rel(*zval_ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC); } else if ((*zval_ptr)->refcount == 1) { + if ((*zval_ptr)->type == IS_OBJECT) { + TSRMLS_FETCH(); + + if (EG(ze1_compatibility_mode)) { + return; + } + } (*zval_ptr)->is_ref = 0; } } http://cvs.php.net/diff.php/ZendEngine2/tests/bug34767.phpt?r1=1.1&r2=1.2&ty=u Index: ZendEngine2/tests/bug34767.phpt diff -u /dev/null ZendEngine2/tests/bug34767.phpt:1.2 --- /dev/null Thu Oct 20 04:15:13 2005 +++ ZendEngine2/tests/bug34767.phpt Thu Oct 20 04:15:13 2005 @@ -0,0 +1,33 @@ +--TEST-- +Bug #34767 (Zend Engine 1 Compatibility not copying objects correctly) +--INI-- +zend.ze1_compatibility_mode=1 +error_reporting=4095 +--FILE-- +<?php +$a->y = &new stdClass(); +print_r($a); +$b = $a; +$a->y->z = 1; +print_r($b); +?> +--EXPECTF-- + +Strict Standards: Assigning the return value of new by reference is deprecated in %sbug34767.php on line 2 +stdClass Object +( + [y] => stdClass Object + ( + ) + +) + +Strict Standards: Implicit cloning object of class 'stdClass' because of 'zend.ze1_compatibility_mode' in %sbug34767.php on line 4 +stdClass Object +( + [y] => stdClass Object + ( + [z] => 1 + ) + +)

« previous php.zend-engine.cvs (#4263) next »