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