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