summaryrefslogtreecommitdiff
path: root/Zend/tests/closure_use_auto_global.phpt
blob: 9ab0897e1298bcaa74b46ed8b55f54697ec46041 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
--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