Annotation of embedaddon/php/Zend/tests/bug39449.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Bug #39449 (Overloaded array properties do not work correctly)
3: --FILE--
4: <?php
5: class A {
6: private $keys = array();
7: public function & __get($val) {
8: return $this->keys[$val];
9: }
10: public function __set($k, $v) {
11: $this->keys[$k] = $v;
12: }
13: }
14:
15: $a =new A();
16: $a->arr = array('a','b','c');
17:
18: $b = &$a->arr;
19: $b[]= 'd';
20:
21: foreach ($a->arr as $k => $v) {
22: echo "$k => $v\n";
23: }
24:
25: $a->arr[]='d';
26:
27: foreach ($a->arr as $k => $v) {
28: echo "$k => $v\n";
29: }
30: ?>
31: --EXPECT--
32: 0 => a
33: 1 => b
34: 2 => c
35: 3 => d
36: 0 => a
37: 1 => b
38: 2 => c
39: 3 => d
40: 4 => d
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>