summaryrefslogtreecommitdiff
path: root/Zend/tests/property_exists.phpt
diff options
context:
space:
mode:
authorFelipe Pena <felipe@php.net>2008-08-18 17:45:19 +0000
committerFelipe Pena <felipe@php.net>2008-08-18 17:45:19 +0000
commitc013b3900983e158909518f53461dc1b17107650 (patch)
tree3995be3465b96a1f2add7cb4adae9e1e6a457ba9 /Zend/tests/property_exists.phpt
parent3efdd8b69bb8ce216e860a68ccd4f2480401b4fb (diff)
downloadphp-git-c013b3900983e158909518f53461dc1b17107650.tar.gz
- New tests
Diffstat (limited to 'Zend/tests/property_exists.phpt')
-rw-r--r--Zend/tests/property_exists.phpt57
1 files changed, 57 insertions, 0 deletions
diff --git a/Zend/tests/property_exists.phpt b/Zend/tests/property_exists.phpt
new file mode 100644
index 0000000000..f6d9a4a4e3
--- /dev/null
+++ b/Zend/tests/property_exists.phpt
@@ -0,0 +1,57 @@
+--TEST--
+Testing property_exists()
+--FILE--
+<?php
+
+class aParent {
+ public static function staticTest() {
+ $a = new A;
+ var_dump(property_exists($a, "prot"));
+ var_dump(property_exists($a, "prot2"));
+ var_dump(property_exists($a, "prot3"));
+ print "------------------\n";
+ var_dump(property_exists("A", "prot"));
+ var_dump(property_exists("A", "prot2"));
+ var_dump(property_exists("A", "prot3"));
+ print "------------------\n";
+ }
+ public function nonstaticTest() {
+ $a = new A;
+ var_dump(property_exists($a, "prot"));
+ var_dump(property_exists($a, "prot2"));
+ var_dump(property_exists($a, "prot3"));
+ print "------------------\n";
+ var_dump(property_exists("A", "prot"));
+ var_dump(property_exists("A", "prot2"));
+ var_dump(property_exists("A", "prot3"));
+ }
+}
+
+class A extends aParent {
+ static public $prot = "prot";
+ static protected $prot2 = "prot";
+ static private $prot3 = "prot";
+}
+
+A::staticTest();
+
+$a = new a;
+$a->nonstaticTest();
+
+?>
+--EXPECT--
+bool(true)
+bool(true)
+bool(true)
+------------------
+bool(true)
+bool(true)
+bool(true)
+------------------
+bool(true)
+bool(true)
+bool(true)
+------------------
+bool(true)
+bool(true)
+bool(true)