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.
26 lines
384 B
26 lines
384 B
<?php
|
|
interface TestInterface
|
|
{
|
|
public function test(): TestInterface;
|
|
}
|
|
|
|
class TestClass implements TestInterface
|
|
{
|
|
public function test(): TestInterface
|
|
{
|
|
return $this;
|
|
}
|
|
|
|
public function foo()
|
|
{
|
|
var_dump(__METHOD__);
|
|
return $this;
|
|
}
|
|
}
|
|
|
|
function main()
|
|
{
|
|
$test = new TestClass();
|
|
$test = $test->test();
|
|
$test->foo();
|
|
} |