summaryrefslogtreecommitdiff
path: root/Zend/tests/bug74840.phpt
diff options
context:
space:
mode:
authorBob Weinand <bobwei9@hotmail.com>2017-07-01 11:52:03 +0200
committerBob Weinand <bobwei9@hotmail.com>2017-07-01 11:52:03 +0200
commite3cc15daf2abc1b4886d4888c3bf5ca9cef035c8 (patch)
tree75d83e60c407d5ecaacdf9277aece164698bc022 /Zend/tests/bug74840.phpt
parent2a1ad885388d1287b7a963d5b9ca9d297163ec19 (diff)
downloadphp-git-e3cc15daf2abc1b4886d4888c3bf5ca9cef035c8.tar.gz
Fixed bug #74840 (Opcache overwrites argument of GENERATOR_RETURN within finally)
Diffstat (limited to 'Zend/tests/bug74840.phpt')
-rw-r--r--Zend/tests/bug74840.phpt21
1 files changed, 21 insertions, 0 deletions
diff --git a/Zend/tests/bug74840.phpt b/Zend/tests/bug74840.phpt
new file mode 100644
index 0000000000..68e27cba84
--- /dev/null
+++ b/Zend/tests/bug74840.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Bug #74840: Opcache overwrites argument of GENERATOR_RETURN within finally
+--FILE--
+<?php
+
+$g = (function($a) {
+ try {
+ return $a + 1;
+ } finally {
+ $b = $a + 2;
+ var_dump($b);
+ }
+ yield; // Generator
+})(1);
+$g->next();
+var_dump($g->getReturn());
+
+?>
+--EXPECT--
+int(3)
+int(2)