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.
33 lines
529 B
33 lines
529 B
--TEST--
|
|
abstract method with reference parameter, passing an already-defined variable
|
|
--FILE--
|
|
<?php
|
|
namespace {
|
|
abstract class Base
|
|
{
|
|
abstract public function abc(&$value);
|
|
|
|
public function run()
|
|
{
|
|
$v = 0;
|
|
$this->abc($v);
|
|
var_dump($v);
|
|
}
|
|
}
|
|
|
|
class Test extends Base
|
|
{
|
|
public function abc(&$value)
|
|
{
|
|
$value = 42;
|
|
}
|
|
}
|
|
|
|
function main()
|
|
{
|
|
(new Test)->run();
|
|
}
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
int(42)
|
|
|