We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b45944a commit c6e6b44Copy full SHA for c6e6b44
ext/spl/tests/bug34548.phpt
@@ -0,0 +1,38 @@
1
+--TEST--
2
+bug #34548 (Method append() in class extended from ArrayObject crashes PHP)
3
+--FILE--
4
+<?php
5
+
6
+class Collection extends ArrayObject
7
+{
8
+ public function add($dataArray)
9
+ {
10
+ foreach($dataArray as $value) $this->append($value);
11
+ }
12
13
+ public function offsetSet($index, $value)
14
15
+ parent::offsetSet($index, $value);
16
17
+}
18
19
+$data1=array('one', 'two', 'three');
20
+$data2=array('four', 'five');
21
22
+$foo=new Collection($data1);
23
+$foo->add($data2);
24
25
+print_r($foo->getArrayCopy());
26
27
+echo "Done\n";
28
+?>
29
+--EXPECT--
30
+Array
31
+(
32
+ [0] => one
33
+ [1] => two
34
+ [2] => three
35
+ [3] => four
36
+ [4] => five
37
+)
38
+Done
0 commit comments