xref: /php-src/Zend/tests/return_types/012.phpt (revision 08b2ab22)
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--EXPECTF--
18object(Closure)#%d (5) {
19  ["name"]=>
20  string(%d) "{closure:%s:%d}"
21  ["file"]=>
22  string(%d) "%s"
23  ["line"]=>
24  int(%d)
25  ["static"]=>
26  array(1) {
27    ["test"]=>
28    string(3) "one"
29  }
30  ["this"]=>
31  object(foo)#%d (0) {
32  }
33}
34