Annotation of embedaddon/php/Zend/tests/objects_032.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Covariant return-by-ref constraints
        !             3: --FILE--
        !             4: <?php
        !             5: 
        !             6: class A implements ArrayAccess {
        !             7:     public $foo = array();
        !             8: 
        !             9:     public function &offsetGet($n) {
        !            10:         return $this->foo[$n];
        !            11:     }
        !            12: 
        !            13:     public function offsetSet($n, $v) {
        !            14:     }
        !            15:     public function offsetUnset($n) {
        !            16:     }
        !            17:     public function offsetExists($n) {
        !            18:     }
        !            19: }
        !            20: 
        !            21: $a = new A;
        !            22: 
        !            23: $a['foo']['bar'] = 2;
        !            24: 
        !            25: var_dump($a);
        !            26: 
        !            27: ?>
        !            28: ==DONE==
        !            29: --EXPECTF--
        !            30: object(A)#1 (1) {
        !            31:   ["foo"]=>
        !            32:   array(1) {
        !            33:     ["foo"]=>
        !            34:     array(1) {
        !            35:       ["bar"]=>
        !            36:       int(2)
        !            37:     }
        !            38:   }
        !            39: }
        !            40: ==DONE==

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