summaryrefslogtreecommitdiff
path: root/ext/spl/tests/spl_iterator_apply_error_001.phpt
blob: 54663c0da889dd6b18b435538217b02377958e03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--TEST--
SPL: Error: iterator_apply when the callback throws an exception
--FILE--
<?php

function test() {
	throw new Exception('Broken callback');
}

$it = new RecursiveArrayIterator(array(1, 21, 22));

try {
	iterator_apply($it, 'test');
} catch (Exception $e) {
	echo $e->getMessage();
}

?>
--EXPECT--
Broken callback