summaryrefslogtreecommitdiff
path: root/ext/reflection/tests
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2016-05-10 12:17:54 +0200
committerNikita Popov <nikic@php.net>2016-05-10 12:17:54 +0200
commit20560da118f888ff4fdcd0ec88aea8a3f911eff4 (patch)
treeec82794a4d88337f0a9f61e53de773cd5eb3ffb3 /ext/reflection/tests
parente6d4a9e2d29fe201acdcc13f1c0b39e9bdd15163 (diff)
parenta1ed4ab3caf33b59742897b43462d033864bb490 (diff)
downloadphp-git-20560da118f888ff4fdcd0ec88aea8a3f911eff4.tar.gz
Merge branch 'PHP-7.0'
Conflicts: ext/reflection/php_reflection.c
Diffstat (limited to 'ext/reflection/tests')
-rw-r--r--ext/reflection/tests/ReflectionProperty_getValue_error.phpt2
-rw-r--r--ext/reflection/tests/bug72174.phpt36
2 files changed, 38 insertions, 0 deletions
diff --git a/ext/reflection/tests/ReflectionProperty_getValue_error.phpt b/ext/reflection/tests/ReflectionProperty_getValue_error.phpt
index c2152e9f87..62009d8bb9 100644
--- a/ext/reflection/tests/ReflectionProperty_getValue_error.phpt
+++ b/ext/reflection/tests/ReflectionProperty_getValue_error.phpt
@@ -78,4 +78,6 @@ Protected property:
Cannot access non-public member TestClass::prot
Instance without property:
+
+Notice: Undefined property: AnotherClass::$pub2 in %s on line %d
NULL
diff --git a/ext/reflection/tests/bug72174.phpt b/ext/reflection/tests/bug72174.phpt
new file mode 100644
index 0000000000..94416d6153
--- /dev/null
+++ b/ext/reflection/tests/bug72174.phpt
@@ -0,0 +1,36 @@
+--TEST--
+Bug #72174: ReflectionProperty#getValue() causes __isset call
+--FILE--
+<?php
+
+class Foo
+{
+ private $bar;
+
+ public function __construct()
+ {
+ unset($this->bar);
+ }
+
+ public function __isset($name)
+ {
+ var_dump(__METHOD__);
+ return true;
+ }
+
+ public function __get($name)
+ {
+ var_dump(__METHOD__);
+ return $name;
+ }
+}
+
+$instance = new Foo();
+$reflectionBar = (new ReflectionProperty(Foo::class, 'bar'));
+$reflectionBar->setAccessible(true);
+var_dump($reflectionBar->getValue($instance));
+
+?>
+--EXPECT--
+string(10) "Foo::__get"
+string(3) "bar"