summaryrefslogtreecommitdiff
path: root/Zend/tests/type_declarations/self_on_closure_in_method.phpt
blob: 2d5bd82ef2b9ef41a7507549265768d3d1137db7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
--TEST--
self return type on closure in a method
--FILE--
<?php

class A {
    public function test() {
        return function() : self {
            return $this;
        };
    }
}

var_dump((new A)->test()());

?>
--EXPECT--
object(A)#1 (0) {
}