1--TEST-- 2Allow defining Closures in class constants. 3--FILE-- 4<?php 5 6class C { 7 const Closure = static function () { 8 echo "called", PHP_EOL; 9 }; 10} 11 12var_dump(C::Closure); 13(C::Closure)(); 14 15?> 16--EXPECTF-- 17object(Closure)#%d (3) { 18 ["name"]=> 19 string(%d) "{closure:%s:%d}" 20 ["file"]=> 21 string(%d) "%s" 22 ["line"]=> 23 int(4) 24} 25called 26