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.
34 lines
471 B
34 lines
471 B
--TEST--
|
|
class extends
|
|
--FILE--
|
|
<?php
|
|
|
|
class BaseObject
|
|
{
|
|
public function foo()
|
|
{
|
|
var_dump(__METHOD__);
|
|
}
|
|
}
|
|
|
|
class ChildObject extends BaseObject
|
|
{
|
|
public function bar() {
|
|
var_dump(__METHOD__);
|
|
}
|
|
}
|
|
|
|
function foo_test(BaseObject $o) {
|
|
$o->foo();
|
|
$o->toObject(ChildObject::class)->bar();
|
|
}
|
|
|
|
function main()
|
|
{
|
|
$o1 = new ChildObject;
|
|
foo_test($o1);
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
string(15) "BaseObject::foo"
|
|
string(16) "ChildObject::bar"
|