mirror of
https://github.com/php/php-src.git
synced 2024-12-22 00:10:16 +08:00
35662c9bd3
Also commit a test I forgot to add for forbidden use() of auto-globals.
16 lines
215 B
PHP
16 lines
215 B
PHP
--TEST--
|
|
Closure cannot use one variable twice
|
|
--FILE--
|
|
<?php
|
|
|
|
$a = 1;
|
|
$fn = function() use ($a, &$a) {
|
|
$a = 2;
|
|
};
|
|
$fn();
|
|
var_dump($a);
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Cannot use variable $a twice in %s on line %d
|