mirror of
https://github.com/php/php-src.git
synced 2024-10-17 06:22:53 +00:00
b501570ab0
#Getting accustomed to the infrastructure. #Any comments are welcome, especially with regard to syntax and keywords.
32 lines
583 B
PHP
32 lines
583 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--
|
|
Warning: Trait method world has not been applied, because there are collisions with other trait methods on MyClass in %s on line %d
|
|
Hello
|
|
Fatal error: Call to undefined method MyClass::world() in %s on line %d
|