xref: /PHP-7.4/Zend/tests/arrow_functions/003.phpt (revision f3e5bbe6)
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--
17Notice: Undefined variable: a in %s on line %d
18NULL
19
20Notice: Undefined variable: 5 in %s on line %d
21NULL
22