summaryrefslogtreecommitdiff
path: root/Zend/tests/bug72215_1.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests/bug72215_1.phpt')
-rw-r--r--Zend/tests/bug72215_1.phpt21
1 files changed, 21 insertions, 0 deletions
diff --git a/Zend/tests/bug72215_1.phpt b/Zend/tests/bug72215_1.phpt
new file mode 100644
index 0000000000..d56c9f881d
--- /dev/null
+++ b/Zend/tests/bug72215_1.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Bug #72215.1 (Wrong return value if var modified in finally)
+--FILE--
+<?php
+function &test(&$b) {
+ $a =& $b;
+ try {
+ return $a;
+ } finally {
+ $a = 2;
+ }
+}
+$x = 1;
+$y =& test($x);
+var_dump($y);
+$x = 3;
+var_dump($y);
+?>
+--EXPECT--
+int(2)
+int(3)