--TEST-- SPL: Error: iterator_to_array when the current operation throws an exception --FILE-- getMessage() . PHP_EOL; } try { // get values $ar = iterator_to_array($it, false); } catch (Exception $e) { echo $e->getMessage() . PHP_EOL; } ?> --EXPECT-- Make the iterator break Make the iterator break