1--TEST-- 2self return type on closure in a method 3--FILE-- 4<?php 5 6class A { 7 public function test() { 8 return function() : self { 9 return $this; 10 }; 11 } 12} 13 14var_dump((new A)->test()()); 15 16?> 17--EXPECT-- 18object(A)#1 (0) { 19} 20