mirror of
https://github.com/php/php-src.git
synced 2024-12-19 15:00:15 +08:00
35662c9bd3
Also commit a test I forgot to add for forbidden use() of auto-globals.
15 lines
239 B
PHP
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
|