xref: /PHP-7.3/Zend/tests/closure_024.phpt (revision b746e698)
1--TEST--
2Closure 024: Clone the Closure object
3--FILE--
4<?php
5
6$a = 1;
7$c = function($add) use(&$a) { return $a+$add; };
8
9$cc = clone $c;
10
11echo $c(10)."\n";
12echo $cc(10)."\n";
13
14$a++;
15
16echo $c(10)."\n";
17echo $cc(10)."\n";
18
19echo "Done.\n";
20?>
21--EXPECT--
2211
2311
2412
2512
26Done.
27