]> granicus.if.org Git - php/commitdiff
Add test for previous commit
authorNikita Popov <nikic@php.net>
Sat, 20 Jun 2015 16:38:46 +0000 (18:38 +0200)
committerNikita Popov <nikic@php.net>
Sat, 20 Jun 2015 16:38:59 +0000 (18:38 +0200)
Zend/tests/generators/aborted_yield_during_new.phpt [new file with mode: 0644]

diff --git a/Zend/tests/generators/aborted_yield_during_new.phpt b/Zend/tests/generators/aborted_yield_during_new.phpt
new file mode 100644 (file)
index 0000000..957b251
--- /dev/null
@@ -0,0 +1,19 @@
+--TEST--
+Aborted yield during object instantiation
+--FILE--
+<?php
+
+class Foo {
+    public function __construct() {}
+}
+
+function gen() {
+    $x = new Foo(yield);
+}
+
+gen()->rewind();
+
+?>
+===DONE===
+--EXPECT--
+===DONE===