Annotation of embedaddon/php/ext/reflection/tests/ReflectionClass_getProperties_001.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: ReflectionClass::getProperties()
                      3: --CREDITS--
                      4: Robin Fernandes <robinf@php.net>
                      5: Steve Seear <stevseea@php.net>
                      6: --FILE--
                      7: <?php
                      8: class pubf {
                      9:        public $a;
                     10:        static public $s;
                     11: }
                     12: class subpubf extends pubf {
                     13: }
                     14: 
                     15: class protf {
                     16:        protected $a;
                     17:        static protected $s;    
                     18: }
                     19: class subprotf extends protf {
                     20: }
                     21: 
                     22: class privf {
                     23:        private $a;
                     24:        static private $s;
                     25: }
                     26: class subprivf extends privf  {
                     27: }
                     28: 
                     29: $classes = array("pubf", "subpubf", "protf", "subprotf", 
                     30:                                 "privf", "subprivf");
                     31: foreach($classes as $class) {
                     32:        echo "Reflecting on class $class: \n";
                     33:        $rc = new ReflectionClass($class);
                     34:        var_dump($rc->getProperties());
                     35: }
                     36: 
                     37: ?>
                     38: --EXPECTF--
                     39: Reflecting on class pubf: 
                     40: array(2) {
                     41:   [0]=>
                     42:   &object(ReflectionProperty)#%d (2) {
                     43:     [%u|b%"name"]=>
                     44:     %unicode|string%(1) "a"
                     45:     [%u|b%"class"]=>
                     46:     %unicode|string%(4) "pubf"
                     47:   }
                     48:   [1]=>
                     49:   &object(ReflectionProperty)#%d (2) {
                     50:     [%u|b%"name"]=>
                     51:     %unicode|string%(1) "s"
                     52:     [%u|b%"class"]=>
                     53:     %unicode|string%(4) "pubf"
                     54:   }
                     55: }
                     56: Reflecting on class subpubf: 
                     57: array(2) {
                     58:   [0]=>
                     59:   &object(ReflectionProperty)#%d (2) {
                     60:     [%u|b%"name"]=>
                     61:     %unicode|string%(1) "a"
                     62:     [%u|b%"class"]=>
                     63:     %unicode|string%(4) "pubf"
                     64:   }
                     65:   [1]=>
                     66:   &object(ReflectionProperty)#%d (2) {
                     67:     [%u|b%"name"]=>
                     68:     %unicode|string%(1) "s"
                     69:     [%u|b%"class"]=>
                     70:     %unicode|string%(4) "pubf"
                     71:   }
                     72: }
                     73: Reflecting on class protf: 
                     74: array(2) {
                     75:   [0]=>
                     76:   &object(ReflectionProperty)#%d (2) {
                     77:     [%u|b%"name"]=>
                     78:     %unicode|string%(1) "a"
                     79:     [%u|b%"class"]=>
                     80:     %unicode|string%(5) "protf"
                     81:   }
                     82:   [1]=>
                     83:   &object(ReflectionProperty)#%d (2) {
                     84:     [%u|b%"name"]=>
                     85:     %unicode|string%(1) "s"
                     86:     [%u|b%"class"]=>
                     87:     %unicode|string%(5) "protf"
                     88:   }
                     89: }
                     90: Reflecting on class subprotf: 
                     91: array(2) {
                     92:   [0]=>
                     93:   &object(ReflectionProperty)#%d (2) {
                     94:     [%u|b%"name"]=>
                     95:     %unicode|string%(1) "a"
                     96:     [%u|b%"class"]=>
                     97:     %unicode|string%(5) "protf"
                     98:   }
                     99:   [1]=>
                    100:   &object(ReflectionProperty)#%d (2) {
                    101:     [%u|b%"name"]=>
                    102:     %unicode|string%(1) "s"
                    103:     [%u|b%"class"]=>
                    104:     %unicode|string%(5) "protf"
                    105:   }
                    106: }
                    107: Reflecting on class privf: 
                    108: array(2) {
                    109:   [0]=>
                    110:   &object(ReflectionProperty)#%d (2) {
                    111:     [%u|b%"name"]=>
                    112:     %unicode|string%(1) "a"
                    113:     [%u|b%"class"]=>
                    114:     %unicode|string%(5) "privf"
                    115:   }
                    116:   [1]=>
                    117:   &object(ReflectionProperty)#%d (2) {
                    118:     [%u|b%"name"]=>
                    119:     %unicode|string%(1) "s"
                    120:     [%u|b%"class"]=>
                    121:     %unicode|string%(5) "privf"
                    122:   }
                    123: }
                    124: Reflecting on class subprivf: 
                    125: array(0) {
                    126: }

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