dis-bench / src /php /php-src /Zend /tests /closures /closure_012.phpt
meddyrat's picture
Replace repository contents with the original corrected artifact
1e94262
Raw History Blame Contribute Delete
368 Bytes
--TEST--
Closure 012: Undefined lexical variables
--FILE--
<?php
$lambda = function () use ($i) {
return ++$i;
};
$lambda();
$lambda();
var_dump($i);
$lambda = function () use (&$i) {
return ++$i;
};
$lambda();
$lambda();
var_dump($i);
?>
--EXPECTF--
Warning: Undefined variable $i in %s on line %d
Warning: Undefined variable $i in %s on line %d
NULL
int(2)