xref: /PHP-7.3/Zend/tests/closure_012.phpt (revision b746e698)
1--TEST--
2Closure 012: Undefined lexical variables
3--FILE--
4<?php
5$lambda = function () use ($i) {
6    return ++$i;
7};
8$lambda();
9$lambda();
10var_dump($i);
11$lambda = function () use (&$i) {
12    return ++$i;
13};
14$lambda();
15$lambda();
16var_dump($i);
17?>
18--EXPECTF--
19Notice: Undefined variable: i in %sclosure_012.php on line 2
20
21Notice: Undefined variable: i in %sclosure_012.php on line 7
22NULL
23int(2)
24