Annotation of embedaddon/php/tests/classes/static_properties_003.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Attempting to access static properties using instance property syntax 
        !             3: --FILE--
        !             4: <?php
        !             5: class C {
        !             6:     public static $x = 'C::$x';
        !             7:     protected static $y = 'C::$y';
        !             8: }
        !             9: 
        !            10: $c = new C;
        !            11: 
        !            12: echo "\n--> Access visible static prop like instance prop:\n";
        !            13: var_dump(isset($c->x));
        !            14: unset($c->x);
        !            15: echo $c->x;
        !            16: $c->x = 1;
        !            17: $ref = 'ref';
        !            18: $c->x =& $ref;
        !            19: var_dump($c->x, C::$x);
        !            20: 
        !            21: echo "\n--> Access non-visible static prop like instance prop:\n";
        !            22: var_dump(isset($c->y));
        !            23: //unset($c->y);                // Fatal error, tested in static_properties_003_error1.phpt
        !            24: //echo $c->y;          // Fatal error, tested in static_properties_003_error2.phpt
        !            25: //$c->y = 1;           // Fatal error, tested in static_properties_003_error3.phpt
        !            26: //$c->y =& $ref;       // Fatal error, tested in static_properties_003_error4.phpt
        !            27: ?>
        !            28: ==Done==
        !            29: --EXPECTF--
        !            30: --> Access visible static prop like instance prop:
        !            31: bool(false)
        !            32: 
        !            33: Strict Standards: Accessing static property C::$x as non static in %s on line 11
        !            34: 
        !            35: Strict Standards: Accessing static property C::$x as non static in %s on line 12
        !            36: 
        !            37: Notice: Undefined property: C::$x in %s on line 12
        !            38: 
        !            39: Strict Standards: Accessing static property C::$x as non static in %s on line 13
        !            40: 
        !            41: Strict Standards: Accessing static property C::$x as non static in %s on line 15
        !            42: 
        !            43: Strict Standards: Accessing static property C::$x as non static in %s on line 16
        !            44: %unicode|string%(3) "ref"
        !            45: %unicode|string%(5) "C::$x"
        !            46: 
        !            47: --> Access non-visible static prop like instance prop:
        !            48: bool(false)
        !            49: ==Done==

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