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