diff options
author | Antony Dovgal <tony2001@php.net> | 2005-09-19 18:59:50 +0000 |
---|---|---|
committer | Antony Dovgal <tony2001@php.net> | 2005-09-19 18:59:50 +0000 |
commit | c6e6b44b826bc06900ef95269565e5676611d75f (patch) | |
tree | b15aa0690545dc23471cc823baaddee405be5c36 | |
parent | b45944a5b365a772a53734d7eda1bd2144390975 (diff) | |
download | php-git-c6e6b44b826bc06900ef95269565e5676611d75f.tar.gz |
MF5.0: add new test
-rw-r--r-- | ext/spl/tests/bug34548.phpt | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/ext/spl/tests/bug34548.phpt b/ext/spl/tests/bug34548.phpt new file mode 100644 index 0000000000..dff1375ab0 --- /dev/null +++ b/ext/spl/tests/bug34548.phpt @@ -0,0 +1,38 @@ +--TEST-- +bug #34548 (Method append() in class extended from ArrayObject crashes PHP) +--FILE-- +<?php + +class Collection extends ArrayObject +{ + public function add($dataArray) + { + foreach($dataArray as $value) $this->append($value); + } + + public function offsetSet($index, $value) + { + parent::offsetSet($index, $value); + } +} + +$data1=array('one', 'two', 'three'); +$data2=array('four', 'five'); + +$foo=new Collection($data1); +$foo->add($data2); + +print_r($foo->getArrayCopy()); + +echo "Done\n"; +?> +--EXPECT-- +Array +( + [0] => one + [1] => two + [2] => three + [3] => four + [4] => five +) +Done |