Annotation of embedaddon/php/Zend/tests/bug50810.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Bug #50810 (property_exists does not work for private)
        !             3: --FILE--
        !             4: <?php
        !             5: 
        !             6: class ExampleSuperClass
        !             7: {
        !             8:     private $foo;
        !             9:     static protected $bar;
        !            10:  
        !            11:     private function foo()
        !            12:     {
        !            13:     }
        !            14:  
        !            15:     public function propertyFooExists()
        !            16:     {
        !            17:         return property_exists($this, 'foo');
        !            18:     }
        !            19:  
        !            20: }
        !            21:  
        !            22: class ExampleSubClass extends ExampleSuperClass
        !            23: {
        !            24:     public function methodExists()
        !            25:     {
        !            26:         return method_exists($this, 'foo');
        !            27:     }
        !            28:  
        !            29:     public function propertyBarExists()
        !            30:     {
        !            31:         return property_exists($this, 'bar');
        !            32:     }
        !            33: }
        !            34:  
        !            35: $example = new ExampleSubClass();
        !            36: var_dump($example->methodExists());
        !            37: var_dump(method_exists($example, 'propertyFooExists'));
        !            38: var_dump($example->propertyFooExists());
        !            39: var_dump($example->propertyBarExists());
        !            40: 
        !            41: ?>
        !            42: --EXPECT--
        !            43: bool(true)
        !            44: bool(true)
        !            45: bool(true)
        !            46: bool(true)

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