mirror of
https://github.com/php/php-src.git
synced 2026-03-24 08:12:21 +01:00
31 lines
504 B
PHP
31 lines
504 B
PHP
--TEST--
|
|
Allow defining FCC for static methods in const expressions.
|
|
--FILE--
|
|
<?php
|
|
|
|
class Foo {
|
|
public static function myMethod(string $foo) {
|
|
echo "Called ", __METHOD__, PHP_EOL;
|
|
var_dump($foo);
|
|
}
|
|
}
|
|
|
|
const Closure = Foo::myMethod(...);
|
|
|
|
var_dump(Closure);
|
|
(Closure)("abc");
|
|
|
|
?>
|
|
--EXPECTF--
|
|
object(Closure)#%d (2) {
|
|
["function"]=>
|
|
string(13) "Foo::myMethod"
|
|
["parameter"]=>
|
|
array(1) {
|
|
["$foo"]=>
|
|
string(10) "<required>"
|
|
}
|
|
}
|
|
Called Foo::myMethod
|
|
string(3) "abc"
|