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.
31 lines
514 B
31 lines
514 B
--TEST--
|
|
Devirtualize: final class $this->method() uses native call
|
|
--FILE--
|
|
<?php
|
|
|
|
class Base {
|
|
public function name(): string {
|
|
return "base";
|
|
}
|
|
}
|
|
|
|
final class Sealed extends Base {
|
|
public function name(): string {
|
|
return "sealed";
|
|
}
|
|
|
|
public function getName(): string {
|
|
return $this->name();
|
|
}
|
|
}
|
|
|
|
function main() {
|
|
$sealed = new Sealed();
|
|
var_dump($sealed->getName());
|
|
var_dump($sealed->name());
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
string(6) "sealed"
|
|
string(6) "sealed"
|
|
|