summaryrefslogtreecommitdiff
path: root/Zend/tests/bug72177_2.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests/bug72177_2.phpt')
-rw-r--r--Zend/tests/bug72177_2.phpt34
1 files changed, 34 insertions, 0 deletions
diff --git a/Zend/tests/bug72177_2.phpt b/Zend/tests/bug72177_2.phpt
new file mode 100644
index 0000000000..718d6c061e
--- /dev/null
+++ b/Zend/tests/bug72177_2.phpt
@@ -0,0 +1,34 @@
+--TEST--
+Bug #72177 Scope issue in __destruct after ReflectionProperty::setValue()
+--FILE--
+<?php
+class Foo
+{
+ private $bar = 'bar';
+
+ public function __construct()
+ {
+ unset($this->bar);
+ }
+}
+
+class Bar extends Foo
+{
+ private $baz = 'baz';
+ private static $tab = 'tab';
+
+ public function __get(string $name)
+ {
+ var_dump($this->baz);
+ var_dump(self::$tab);
+ return $name;
+ }
+}
+
+$r = new ReflectionProperty(Foo::class, 'bar');
+
+$r->setAccessible(true);
+echo "OK\n";
+?>
+--EXPECT--
+OK