File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / Zend / tests / bug50810.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:47:52 2012 UTC (13 years, 1 month ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

    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>