]> granicus.if.org Git - php/commitdiff
Revert "Fixed bug #70321 (Magic getter breaks reference to array property)"
authorXinchen Hui <laruence@php.net>
Sun, 23 Aug 2015 02:40:28 +0000 (10:40 +0800)
committerXinchen Hui <laruence@php.net>
Sun, 23 Aug 2015 02:40:28 +0000 (10:40 +0800)
This reverts commit 66754585f889e56ddaf3442fd4ac7b9adf93417b.

NEWS
Zend/tests/bug70321.phpt [deleted file]
Zend/zend_execute.c

diff --git a/NEWS b/NEWS
index 4fdf0e698d4d45e60fa3b72775ce028e13b52932..f92f2838e20efade4df03f7ad7ee5b1ce5b9a992 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -7,7 +7,6 @@ PHP                                                                        NEWS
   . Fixed bug #70300 (Syntactical inconsistency with new group use syntax).
     (marcio dot web2 at gmail dot com)
   . Fixed bug causing exception traces with anon classes to be truncated. (Bob)
-  . Fixed bug #70321 (Magic getter breaks reference to array property). (Bob)
 
 - PDO_OCI:
   . Fixed bug #70308 (PDO::ATTR_PREFETCH is ignored). (Chris Jones)
diff --git a/Zend/tests/bug70321.phpt b/Zend/tests/bug70321.phpt
deleted file mode 100644 (file)
index b1cb87f..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
---TEST--
-Bug #70321 (Magic getter breaks reference to array property)
---FILE--
-<?php
-
-class foo {
-       private $bar;
-       public function __construct() {
-               $this->bar = new bar();
-       }
-
-       public function &__get($key) {
-               $bar = $this->bar;
-               // no direct reference to $this->bar
-               return $bar;
-       }
-}
-
-class bar { public $baz = []; }
-
-$foo = new foo();
-$foo->bar->baz[] = function() {};
-var_dump($foo->bar->baz);
-
-?>
---EXPECTF--
-array(1) {
-  [0]=>
-  object(Closure)#%d (0) {
-  }
-}
index edb1f9de7a0e1ed613010fe8972976a829e7615b..59f936d2a374245f47082e243b1a96713d7a3d1d 100644 (file)
@@ -89,7 +89,7 @@ static const zend_internal_function zend_pass_function = {
 #define zval_ptr_dtor(zv) i_zval_ptr_dtor(zv ZEND_FILE_LINE_CC)
 
 #define READY_TO_DESTROY(zv) \
-       (EXPECTED(zv) && Z_REFCOUNTED_P(zv) && Z_REFCOUNT_P(zv) == 1 && (EXPECTED(Z_ISREF_P(zv) == 0) || Z_REFCOUNTED_P(Z_REFVAL_P(zv)) && Z_REFCOUNT_P(Z_REFVAL_P(zv)) == 1))
+       (UNEXPECTED(zv) && Z_REFCOUNTED_P(zv) && Z_REFCOUNT_P(zv) == 1)
 
 #define EXTRACT_ZVAL_PTR(zv, check_null) do {          \
        zval *__zv = (zv);                                                              \