dis-bench / src /php /php-src /Zend /tests /closures /closure_024.phpt
meddyrat's picture
Replace repository contents with the original corrected artifact
1e94262
Raw History Blame Contribute Delete
270 Bytes
--TEST--
Closure 024: Clone the Closure object
--FILE--
<?php
$a = 1;
$c = function($add) use(&$a) { return $a+$add; };
$cc = clone $c;
echo $c(10)."\n";
echo $cc(10)."\n";
$a++;
echo $c(10)."\n";
echo $cc(10)."\n";
echo "Done.\n";
?>
--EXPECT--
11
11
12
12
Done.