summaryrefslogtreecommitdiff
path: root/ext/spl/tests/arrayObject___construct_error2.phpt
blob: 7850a453b43401b63a1f1be11c6e7e3fa0d22131 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--TEST--
SPL: ArrayObject::__construct with too many arguments.
--FILE--
<?php
echo "Too many arguments:\n";
Class C implements Iterator {
    function current() {}
    function next() {}
    function key() {}
    function valid() {}
    function rewind() {}
}

try {
  var_dump(new ArrayObject(new stdClass, 0, "C", "extra"));
} catch (TypeError $e) {
  echo $e->getMessage() . "(" . $e->getLine() .  ")\n";
}
?>
--EXPECT--
Too many arguments:
ArrayObject::__construct() expects at most 3 arguments, 4 given(12)