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.
 
 

38 lines
523 B

--TEST--
Trait insteadof works regardless of trait list order
--FILE--
<?php
trait TraitOrderA
{
public function hello(): void
{
echo "A\n";
}
}
trait TraitOrderB
{
public function hello(): void
{
echo "B\n";
}
}
class TraitOrderUser
{
use TraitOrderB, TraitOrderA {
TraitOrderB::hello insteadof TraitOrderA;
TraitOrderA::hello as helloA;
}
}
function main()
{
$user = new TraitOrderUser();
$user->hello();
$user->helloA();
}
?>
--EXPECT--
B
A