mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
26 lines
347 B
PHP
26 lines
347 B
PHP
--TEST--
|
|
Allow defining Closures in class constants.
|
|
--FILE--
|
|
<?php
|
|
|
|
class C {
|
|
const Closure = static function () {
|
|
echo "called", PHP_EOL;
|
|
};
|
|
}
|
|
|
|
var_dump(C::Closure);
|
|
(C::Closure)();
|
|
|
|
?>
|
|
--EXPECTF--
|
|
object(Closure)#%d (3) {
|
|
["name"]=>
|
|
string(%d) "{closure:%s:%d}"
|
|
["file"]=>
|
|
string(%d) "%s"
|
|
["line"]=>
|
|
int(4)
|
|
}
|
|
called
|