xref: /PHP-8.2/Zend/tests/arrow_functions/003.phpt (revision 36935e42)
1--TEST--
2Variable-variables inside arrow functions
3--FILE--
4<?php
5
6$a = 1;
7$var = "a";
8$fn = fn() => $$var;
9var_dump($fn());
10
11${5} = 2;
12$fn = fn() => ${5};
13var_dump($fn());
14
15?>
16--EXPECTF--
17Warning: Undefined variable $a in %s on line %d
18NULL
19
20Warning: Undefined variable $5 in %s on line %d
21NULL
22