1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
--TEST-- Bug #72216 (Return by reference with finally is not memory safe) --FILE-- <?php function &test() { $a = ["ok"]; try { return $a[0]; } finally { $a[""] = 42; } } var_dump(test()); ?> --EXPECT-- string(2) "ok"