--TEST-- Changing from an iterable type to a non iterable type during the iteration --FILE-- a=1; $a->b=2; $b=&$a; foreach ($a as $v) { var_dump($v); $b='x'; } ?> --EXPECT-- Change from array to non iterable: int(1) int(2) int(3) Change from object to non iterable: int(1) int(2)