mirror of
https://github.com/php/php-src.git
synced 2024-10-17 06:22:53 +00:00
30 lines
518 B
PHP
30 lines
518 B
PHP
--TEST--
|
|
Aliasing leading to conflict should result in error message
|
|
--FILE--
|
|
<?php
|
|
error_reporting(E_ALL);
|
|
|
|
trait Hello {
|
|
public function hello() {
|
|
echo 'Hello';
|
|
}
|
|
}
|
|
|
|
trait World {
|
|
public function world() {
|
|
echo ' World!';
|
|
}
|
|
}
|
|
|
|
|
|
class MyClass {
|
|
use Hello, World { hello as world; }
|
|
}
|
|
|
|
$o = new MyClass();
|
|
$o->hello();
|
|
$o->world();
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Failed to add trait method (world) to the trait table. There is probably already a trait method with the same name in %s on line %d
|