Annotation of embedaddon/php/ext/reflection/tests/bug49074.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Bug #49074 (private class static fields can be modified by using reflection)
        !             3: --FILE--
        !             4: <?php
        !             5: class Test {
        !             6:        private static $data1 = 1;
        !             7:        private static $data4 = 4;
        !             8: }
        !             9: 
        !            10: class Test2 extends Test {
        !            11:        private static $data2 = 2;
        !            12:        public static $data3 = 3;
        !            13: }
        !            14: 
        !            15: $r = new ReflectionClass('Test2');
        !            16: $m = $r->getStaticProperties();
        !            17: 
        !            18: $m['data1'] = 100;
        !            19: $m['data2'] = 200;
        !            20: $m['data3'] = 300;
        !            21: $m['data4'] = 400;
        !            22: 
        !            23: var_dump($r->getStaticProperties());
        !            24: ?>
        !            25: --EXPECT--
        !            26: array(2) {
        !            27:   ["data2"]=>
        !            28:   int(2)
        !            29:   ["data3"]=>
        !            30:   int(3)
        !            31: }

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