diff options
author | Marcus Boerger <helly@php.net> | 2006-07-10 00:36:28 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2006-07-10 00:36:28 +0000 |
commit | 704eced26b361c6ac9a9e04700cb46d27da6b16f (patch) | |
tree | 658f49a2bcc206a518f2007acddca8a0014939ee /Zend/tests/bug37667.phpt | |
parent | 71efa5b435f032b3a88204d8771b4f83869bec26 (diff) | |
download | php-git-704eced26b361c6ac9a9e04700cb46d27da6b16f.tar.gz |
- MFH Fixed Bug #37667 (Object is not added into array returned by __get)
Diffstat (limited to 'Zend/tests/bug37667.phpt')
-rwxr-xr-x | Zend/tests/bug37667.phpt | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/Zend/tests/bug37667.phpt b/Zend/tests/bug37667.phpt new file mode 100755 index 0000000000..429a9be3af --- /dev/null +++ b/Zend/tests/bug37667.phpt @@ -0,0 +1,43 @@ +--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 %d +NULL +object(Test)#%d (1) { + ["property:protected"]=> + array(1) { + ["foo"]=> + string(3) "bar" + } +} + +Fatal error: Cannot use array returned from Test::__get('property') in write context in %sbug37667.php on line %d |