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

1.1       misho       1: --TEST--
                      2: ReflectionProperty::getModifiers()
                      3: --CREDITS--
                      4: Robin Fernandes <robinf@php.net>
                      5: Steve Seear <stevseea@php.net>
                      6: --FILE--
                      7: <?php
                      8: 
                      9: function reflectProperty($class, $property) {
                     10:        $propInfo = new ReflectionProperty($class, $property);
                     11:        
                     12:        echo "**********************************\n";
                     13:        echo "Reflecting on property $class::$property\n\n";
                     14:        
                     15:        echo "getModifiers():\n";
                     16:        var_dump($propInfo->getModifiers());
                     17:        
                     18:        echo "\n**********************************\n";
                     19: }
                     20: 
                     21: class TestClass
                     22: {
                     23:     public $pub;
                     24:     static public $stat = "static property";
                     25:     /**
                     26:         * This property has a comment. 
                     27:         */
                     28:     protected $prot = 4;
                     29:     private $priv = "keepOut";
                     30: }
                     31: 
                     32: reflectProperty("TestClass", "pub");
                     33: reflectProperty("TestClass", "stat");
                     34: reflectProperty("TestClass", "prot");
                     35: reflectProperty("TestClass", "priv");
                     36: 
                     37: ?>
                     38: --EXPECT--
                     39: **********************************
                     40: Reflecting on property TestClass::pub
                     41: 
                     42: getModifiers():
                     43: int(256)
                     44: 
                     45: **********************************
                     46: **********************************
                     47: Reflecting on property TestClass::stat
                     48: 
                     49: getModifiers():
                     50: int(257)
                     51: 
                     52: **********************************
                     53: **********************************
                     54: Reflecting on property TestClass::prot
                     55: 
                     56: getModifiers():
                     57: int(512)
                     58: 
                     59: **********************************
                     60: **********************************
                     61: Reflecting on property TestClass::priv
                     62: 
                     63: getModifiers():
                     64: int(1024)
                     65: 
                     66: **********************************

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