📄 Viewing: spl_iterator_apply_error_001.phpt

--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

🌑 DarkStealth — WP Plugin Edition

Directory: /usr/src/php-7.4.23/ext/spl/tests