summaryrefslogtreecommitdiff
path: root/Zend/tests/objects_032.phpt
blob: e5e3ecadb2e7baf34d16278bcaa27f4b109dd5da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
--TEST--
Covariant return-by-ref constraints
--FILE--
<?php

class A implements ArrayAccess {
    public $foo = array();

    public function &offsetGet($n) {
        return $this->foo[$n];
    }

    public function offsetSet($n, $v) {
    }
    public function offsetUnset($n) {
    }
    public function offsetExists($n) {
    }
}

$a = new A;

$a['foo']['bar'] = 2;

var_dump($a);

?>
==DONE==
--EXPECTF--
object(A)#1 (1) {
  ["foo"]=>
  array(1) {
    ["foo"]=>
    array(1) {
      ["bar"]=>
      int(2)
    }
  }
}
==DONE==