TypePHP 编译器
https://swoole.com/aot/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
560 B
35 lines
560 B
--TEST--
|
|
dynamic static method name with side effects
|
|
--FILE--
|
|
<?php
|
|
|
|
class DynamicStaticMethodTarget
|
|
{
|
|
public static function render(string $value): string
|
|
{
|
|
return 'render:' . $value;
|
|
}
|
|
}
|
|
|
|
function choose_static_method(): string
|
|
{
|
|
echo "method\n";
|
|
return 'render';
|
|
}
|
|
|
|
function make_static_arg(): string
|
|
{
|
|
echo "arg\n";
|
|
return 'value';
|
|
}
|
|
|
|
function main(): void
|
|
{
|
|
$method = choose_static_method();
|
|
var_dump(DynamicStaticMethodTarget::$method(make_static_arg()));
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
method
|
|
arg
|
|
string(12) "render:value"
|
|
|