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.
22 lines
420 B
22 lines
420 B
<?php
|
|
// 子类先于父类定义,测试 classMethodOverride 的双向递归是否正确
|
|
class ChildOverride extends ParentBase {
|
|
public function bar(): void {
|
|
echo "Child\n";
|
|
}
|
|
}
|
|
|
|
class ParentBase {
|
|
public function run(): void {
|
|
$this->bar();
|
|
}
|
|
|
|
public function bar(): void {
|
|
echo "Parent\n";
|
|
}
|
|
}
|
|
|
|
function main(): void {
|
|
$o = new ChildOverride();
|
|
$o->run();
|
|
}
|
|
|