summaryrefslogtreecommitdiff
path: root/Zend/tests/bug37667.phpt
blob: ecf43c5b80b3a9424f416aabcf012f785749cb87 (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
41
42
43
44
45
46
47
48
49
50
51
52
53
--TEST--
Bug #37667 (Object is not added into array returned by __get)
--FILE--
<?php

class Test
{
	protected $property = array('foo' => 'bar');

	function __get($name)
	{
		return $this->property;
	}
}

$obj = new Test;

var_dump($obj->property['foo']);
var_dump($obj->property[2]);

var_dump($obj);

$obj->property[] = 1;
$obj->property[] = 2;

var_dump($obj);

?>
===DONE===
--EXPECTF--
string(3) "bar"

Notice: Undefined offset: 2 in %sbug37667.php on line 16
NULL
object(Test)#%d (1) {
  ["property":protected]=>
  array(1) {
    ["foo"]=>
    string(3) "bar"
  }
}

Notice: Indirect modification of overloaded property Test::$property has no effect in %sbug37667.php on line 20

Notice: Indirect modification of overloaded property Test::$property has no effect in %sbug37667.php on line 21
object(Test)#%d (1) {
  ["property":protected]=>
  array(1) {
    ["foo"]=>
    string(3) "bar"
  }
}
===DONE===