summaryrefslogtreecommitdiff
path: root/Zend/tests/return_types/012.phpt
blob: 39fa8e0ec6b769e30c0caedb15cfcaa86cc4a6d9 (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
27
28
--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) {
  }
}