cvs: php-src /ext/spl/tests bug34548.phpt

From: Date: Mon, 19 Sep 2005 18:59:50 +0000
Subject: cvs: php-src /ext/spl/tests bug34548.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-34022@lists.php.net to get a copy of this message
tony2001 Mon Sep 19 14:59:50 2005 EDT Modified files: /php-src/ext/spl/tests bug34548.phpt Log: MF5.0: add new test http://cvs.php.net/diff.php/php-src/ext/spl/tests/bug34548.phpt?r1=1.1&r2=1.2&ty=u Index: php-src/ext/spl/tests/bug34548.phpt diff -u /dev/null php-src/ext/spl/tests/bug34548.phpt:1.2 --- /dev/null Mon Sep 19 14:59:50 2005 +++ php-src/ext/spl/tests/bug34548.phpt Mon Sep 19 14:59:50 2005 @@ -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

« previous php.cvs (#34022) next »