blob: 399aa3378807646a9d9a8b963ad87d2f48357cb1 (
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
|
--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
|