mirror of
https://github.com/php/php-src.git
synced 2026-04-29 11:13:36 +02:00
a50f82bebf
Move more tests into existing directories Work towards GH-15631
27 lines
344 B
PHP
27 lines
344 B
PHP
--TEST--
|
|
Closure in static property initializer
|
|
--FILE--
|
|
<?php
|
|
|
|
class C {
|
|
public static Closure $d = static function () {
|
|
echo "called", PHP_EOL;
|
|
};
|
|
}
|
|
|
|
var_dump(C::$d);
|
|
(C::$d)();
|
|
|
|
|
|
?>
|
|
--EXPECTF--
|
|
object(Closure)#%d (3) {
|
|
["name"]=>
|
|
string(%d) "{closure:%s:%d}"
|
|
["file"]=>
|
|
string(%d) "%s"
|
|
["line"]=>
|
|
int(4)
|
|
}
|
|
called
|