summaryrefslogtreecommitdiff
path: root/Zend/tests/return_types/022.phpt
blob: 47cbb791df3fb2938d34e44e69fe2f501b80ce11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
--TEST--
Hint on closure with lexical vars

--FILE--
<?php
$foo = "bar";
$test = function() use($foo) : Closure {
    return function() use ($foo) {
        return $foo;
    };
};

$callable = $test();
var_dump($callable());

--EXPECTF--
string(3) "bar"