summaryrefslogtreecommitdiff
path: root/Zend/tests
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2012-12-20 20:33:18 +0100
committerNikita Popov <nikic@php.net>2012-12-20 20:33:18 +0100
commit3e78c6ad25fdf07259bfaaa3e2e33fb0914e5e61 (patch)
tree76eebcfc9acdd7e88d061091d9369ce13e30a8c6 /Zend/tests
parentd5fe89670ee76baeb50664f5460991892ee77d8c (diff)
downloadphp-git-3e78c6ad25fdf07259bfaaa3e2e33fb0914e5e61.tar.gz
Do not add a ref to EX(object) on generator clone
If a ref has to be added it will be already added while walking the call slots.
Diffstat (limited to 'Zend/tests')
-rw-r--r--Zend/tests/generators/clone_after_object_call.phpt20
1 files changed, 20 insertions, 0 deletions
diff --git a/Zend/tests/generators/clone_after_object_call.phpt b/Zend/tests/generators/clone_after_object_call.phpt
new file mode 100644
index 0000000000..0a424268cc
--- /dev/null
+++ b/Zend/tests/generators/clone_after_object_call.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Cloning a generator after an object method was called
+--FILE--
+<?php
+
+class A { public function b() { } }
+
+function gen() {
+ $a = new A;
+ $a->b();
+ yield;
+}
+
+$g1 = gen();
+$g1->rewind();
+$g2 = clone $g1;
+
+echo "Done";
+--EXPECT--
+Done