Annotation of embedaddon/php/Zend/tests/property_exists.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Testing property_exists()
                      3: --FILE--
                      4: <?php
                      5: 
                      6: class aParent {
                      7:        public static function staticTest() {
                      8:                $a = new A;
                      9:                var_dump(property_exists($a, "prot"));
                     10:                var_dump(property_exists($a, "prot2"));
                     11:                var_dump(property_exists($a, "prot3"));
                     12:                print "------------------\n";
                     13:                var_dump(property_exists("A", "prot"));
                     14:                var_dump(property_exists("A", "prot2"));
                     15:                var_dump(property_exists("A", "prot3"));
                     16:                print "------------------\n";           
                     17:        }
                     18:        public function nonstaticTest() {
                     19:                $a = new A;
                     20:                var_dump(property_exists($a, "prot"));
                     21:                var_dump(property_exists($a, "prot2"));
                     22:                var_dump(property_exists($a, "prot3"));
                     23:                print "------------------\n";
                     24:                var_dump(property_exists("A", "prot"));
                     25:                var_dump(property_exists("A", "prot2"));
                     26:                var_dump(property_exists("A", "prot3"));
                     27:        }
                     28: }
                     29: 
                     30: class A extends aParent {
                     31:        static public $prot = "prot";
                     32:        static protected $prot2 = "prot";
                     33:        static private $prot3 = "prot";
                     34: }
                     35: 
                     36: A::staticTest();
                     37: 
                     38: $a = new a;
                     39: $a->nonstaticTest();
                     40: 
                     41: ?>
                     42: --EXPECT--
                     43: bool(true)
                     44: bool(true)
                     45: bool(true)
                     46: ------------------
                     47: bool(true)
                     48: bool(true)
                     49: bool(true)
                     50: ------------------
                     51: bool(true)
                     52: bool(true)
                     53: bool(true)
                     54: ------------------
                     55: bool(true)
                     56: bool(true)
                     57: bool(true)

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>