xref: /PHP-8.2/Zend/tests/return_types/012.phpt (revision 7aacc705)
1--TEST--
2Method returned callable, expected callable
3--FILE--
4<?php
5class foo {
6    public function bar() : callable {
7        $test = "one";
8        return function() use($test) : array {
9            return array($test);
10        };
11    }
12}
13
14$baz = new foo();
15var_dump($baz->bar());
16?>
17--EXPECT--
18object(Closure)#2 (2) {
19  ["static"]=>
20  array(1) {
21    ["test"]=>
22    string(3) "one"
23  }
24  ["this"]=>
25  object(foo)#1 (0) {
26  }
27}
28