summaryrefslogtreecommitdiff
path: root/ext/spl/tests/spl_iterator_iterator_constructor.phpt
blob: 2349a13e3160799274d9dc0ce92e5e158520a33f (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
--TEST--
SPL: IteratorInterator constructor checks
--CREDITS--
Sean Burlington www.practicalweb.co.uk
TestFest London May 2009
--FILE--
<?php

$array = array(array(7,8,9),1,2,3,array(4,5,6));
$arrayIterator = new ArrayIterator($array);
try {
    $test = new IteratorIterator($arrayIterator);

    $test = new IteratorIterator($arrayIterator, 1);
    $test = new IteratorIterator($arrayIterator, 1, 1);
    $test = new IteratorIterator($arrayIterator, 1, 1, 1);
    $test = new IteratorIterator($arrayIterator, 1, 1, 1, 1);
} catch (TypeError $e){
  echo $e->getMessage() . "\n";
}

?>
--EXPECT--
IteratorIterator::__construct() expects at most 2 arguments, 3 given