summaryrefslogtreecommitdiff
path: root/Zend/tests/return_types/012.phpt
blob: b4c02a8ec1ccaefc4a763cc1bc4cecd6713068fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
--TEST--
Method returned callable, expected callable
--FILE--
<?php
class foo {
    public function bar() : callable {
        $test = "one";
        return function() use($test) : array {
            return array($test);
        };
    }
}

$baz = new foo();
var_dump($baz->bar());
--EXPECT--
object(Closure)#2 (2) {
  ["static"]=>
  array(1) {
    ["test"]=>
    string(3) "one"
  }
  ["this"]=>
  object(foo)#1 (0) {
  }
}