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

1.1       misho       1: --TEST--
                      2: Bug #40794 (ReflectionObject::getValues() may crash when used with dynamic properties)
                      3: --FILE--
                      4: <?php
                      5: 
                      6: $obj = new stdClass();
                      7: $obj->prop1 = '1';
                      8: $obj->prop2 = '2';
                      9: $obj->prop3 = '3';
                     10: 
                     11: $reflect = new ReflectionObject($obj);
                     12: 
                     13: $array = array();
                     14: foreach($reflect->getProperties() as $prop)
                     15: {
                     16:        $array[$prop->getName()] = $prop->getValue($obj);
                     17: }
                     18: 
                     19: var_dump($array);
                     20: 
                     21: echo "Done\n";
                     22: ?>
                     23: --EXPECTF--    
                     24: array(3) {
                     25:   ["prop1"]=>
                     26:   string(1) "1"
                     27:   ["prop2"]=>
                     28:   string(1) "2"
                     29:   ["prop3"]=>
                     30:   string(1) "3"
                     31: }
                     32: Done

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