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