--TEST-- Throwing into a generator yielding from an array/iterator --FILE-- current()); try { $g->throw(new Exception("Exception!")); } catch (Exception $e) { echo "{$e->getMessage()}\n"; } var_dump($g->current()); } $yfiter = yf($data); $yfgen = yf(yielditer($data)); test(yf($data)); echo "\n"; test(yf(yielditer($data))); ?> --EXPECT-- int(1) Exception! NULL int(1) Exception! NULL