mirror of
https://github.com/php/php-src.git
synced 2026-04-25 08:58:28 +02:00
f3e5bbe6f3
Per RFC: https://wiki.php.net/rfc/arrow_functions_v2 Co-authored-by: Levi Morrison <levim@php.net> Co-authored-by: Bob Weinand <bobwei9@hotmail.com>
14 lines
200 B
PHP
14 lines
200 B
PHP
--TEST--
|
|
Auto-globals in arrow functions
|
|
--FILE--
|
|
<?php
|
|
|
|
// This should work, but *not* generate a binding for $GLOBALS
|
|
$a = 123;
|
|
$fn = fn() => $GLOBALS['a'];
|
|
var_dump($fn());
|
|
|
|
?>
|
|
--EXPECT--
|
|
int(123)
|