summaryrefslogtreecommitdiff
path: root/ext/reflection/tests/bug39001.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/reflection/tests/bug39001.phpt')
-rw-r--r--ext/reflection/tests/bug39001.phpt27
1 files changed, 27 insertions, 0 deletions
diff --git a/ext/reflection/tests/bug39001.phpt b/ext/reflection/tests/bug39001.phpt
new file mode 100644
index 000000000..1ed675f02
--- /dev/null
+++ b/ext/reflection/tests/bug39001.phpt
@@ -0,0 +1,27 @@
+--TEST--
+Bug #39001 (ReflectionProperty returns incorrect declaring class for protected properties)
+--FILE--
+<?php
+
+class Meta {
+}
+
+class CParent extends Meta {
+ public $publicVar;
+ protected $protectedVar;
+}
+
+class Child extends CParent {
+}
+
+$r = new ReflectionClass('Child');
+
+var_dump($r->getProperty('publicVar')->getDeclaringClass()->getName());
+var_dump($r->getProperty('protectedVar')->getDeclaringClass()->getName());
+
+echo "Done\n";
+?>
+--EXPECTF--
+string(7) "CParent"
+string(7) "CParent"
+Done