2006-07-10 08:36:28 +08:00
|
|
|
--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"
|
|
|
|
|
2008-03-08 20:01:53 +08:00
|
|
|
Notice: Undefined offset: 2 in %sbug37667.php on line 16
|
2006-07-10 08:36:28 +08:00
|
|
|
NULL
|
|
|
|
object(Test)#%d (1) {
|
2007-11-03 03:41:12 +08:00
|
|
|
["property":protected]=>
|
2006-07-10 08:36:28 +08:00
|
|
|
array(1) {
|
|
|
|
["foo"]=>
|
|
|
|
string(3) "bar"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-07-21 18:32:17 +08:00
|
|
|
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) {
|
2007-11-03 03:41:12 +08:00
|
|
|
["property":protected]=>
|
2006-07-21 18:32:17 +08:00
|
|
|
array(1) {
|
|
|
|
["foo"]=>
|
|
|
|
string(3) "bar"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
===DONE===
|