]> granicus.if.org Git - php/commitdiff
- New test
authorFelipe Pena <felipe@php.net>
Sun, 7 Mar 2010 00:57:19 +0000 (00:57 +0000)
committerFelipe Pena <felipe@php.net>
Sun, 7 Mar 2010 00:57:19 +0000 (00:57 +0000)
Zend/tests/bug50810.phpt [new file with mode: 0644]

diff --git a/Zend/tests/bug50810.phpt b/Zend/tests/bug50810.phpt
new file mode 100644 (file)
index 0000000..8b4d719
--- /dev/null
@@ -0,0 +1,46 @@
+--TEST--
+Bug #50810 (property_exists does not work for private)
+--FILE--
+<?php
+
+class ExampleSuperClass
+{
+    private $foo;
+    static protected $bar;
+    private function foo()
+    {
+    }
+    public function propertyFooExists()
+    {
+        return property_exists($this, 'foo');
+    }
+}
+class ExampleSubClass extends ExampleSuperClass
+{
+    public function methodExists()
+    {
+        return method_exists($this, 'foo');
+    }
+    public function propertyBarExists()
+    {
+        return property_exists($this, 'bar');
+    }
+}
+$example = new ExampleSubClass();
+var_dump($example->methodExists());
+var_dump(method_exists($example, 'propertyFooExists'));
+var_dump($example->propertyFooExists());
+var_dump($example->propertyBarExists());
+
+?>
+--EXPECT--
+bool(true)
+bool(true)
+bool(true)
+bool(true)