self_on_closure_in_method.phpt   [plain text]


--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) {
}