xref: /php-src/Zend/tests/return_types/022.phpt (revision 7aacc705)
1--TEST--
2Hint on closure with lexical vars
3--FILE--
4<?php
5$foo = "bar";
6$test = function() use($foo) : Closure {
7    return function() use ($foo) {
8        return $foo;
9    };
10};
11
12$callable = $test();
13var_dump($callable());
14?>
15--EXPECT--
16string(3) "bar"
17