php-src/Zend/tests/closure_use_parameter_name.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

15 lines
239 B
PHP

--TEST--
Can't use name of lexical variable for parameter
--FILE--
<?php
$a = 1;
$fn = function ($a) use ($a) {
var_dump($a);
};
$fn(2);
?>
--EXPECTF--
Fatal error: Cannot use lexical variable $a as a parameter name in %s on line %d