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.
29 lines
458 B
29 lines
458 B
--TEST--
|
|
Native class: shell command interpolation uses the declared toString method
|
|
--SKIPIF--
|
|
<?php
|
|
if (PHP_OS_FAMILY === 'Windows') {
|
|
die('skip shell command is POSIX-specific');
|
|
}
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
|
|
#[Native]
|
|
class NativeShellCommand
|
|
{
|
|
public function toString(): string
|
|
{
|
|
return 'printf native-shell';
|
|
}
|
|
}
|
|
|
|
function main(): void
|
|
{
|
|
$command = new NativeShellCommand();
|
|
echo `$command`, "\n";
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
native-shell
|
|
|