php-src/Zend/tests/closure_use_auto_global.phpt
Nikita Popov 35662c9bd3 Forbid double use() and use() of param
Also commit a test I forgot to add for forbidden use() of
auto-globals.
2016-01-12 15:37:39 +01:00

17 lines
250 B
PHP

--TEST--
Cannot use() auto-global
--FILE--
<?php
function test() {
$fn = function() use($GLOBALS) {
var_dump($GLOBALS);
};
$fn();
}
test();
?>
--EXPECTF--
Fatal error: Cannot use auto-global as lexical variable in %s on line %d