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