diff options
author | Dmitry Stogov <dmitry@php.net> | 2005-10-20 08:14:59 +0000 |
---|---|---|
committer | Dmitry Stogov <dmitry@php.net> | 2005-10-20 08:14:59 +0000 |
commit | 03cb8e959b20f38245e66db129764d66f4fee334 (patch) | |
tree | b927a6b951e21aeb8eaf7c8e90593318d37ad49f | |
parent | d32c6512e1052f3c89fe0604ae1b5748d438c624 (diff) | |
download | php-git-03cb8e959b20f38245e66db129764d66f4fee334.tar.gz |
Fixed bug #34767 (Zend Engine 1 Compatibility not copying objects correctly)
-rw-r--r-- | NEWS | 2 | ||||
-rwxr-xr-x | Zend/tests/bug34767.phpt | 33 | ||||
-rw-r--r-- | Zend/zend_execute_API.c | 7 |
3 files changed, 42 insertions, 0 deletions
@@ -4,6 +4,8 @@ PHP NEWS - Fixed bug #34905 (Digest authentication does not work with Apache 1). (Ilia) - Fixed bug #34902 (mysqli::character_set_name() - undefined method). (Tony) - Fixed bug #34899 (Fixed sqlite extension compile failure). (Ilia) +- Fixed bug #34767 (Zend Engine 1 Compatibility not copying objects correctly). + (Dmitry) - Fixed bug #33829 (mime_content_type() returns text/plain for gzip and bzip files). (Derick) - Fixed bug #34623 (Crash in pdo_mysql on longtext fields). (Ilia) diff --git a/Zend/tests/bug34767.phpt b/Zend/tests/bug34767.phpt new file mode 100755 index 0000000000..45af9f944c --- /dev/null +++ b/Zend/tests/bug34767.phpt @@ -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 + ) + +) diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 9022ee0de3..c745e65798 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -386,6 +386,13 @@ ZEND_API void _zval_ptr_dtor(zval **zval_ptr ZEND_FILE_LINE_DC) 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; } } |