mirror of
https://github.com/php/php-src.git
synced 2024-10-16 22:12:33 +00:00
8ba00176f1
- missed a failing Traits test, but is now fixed, and the bug covered by a dedicated test # Should always comment conditions that go over more than two lines :-/
30 lines
509 B
PHP
30 lines
509 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: Trait method world has not been applied, because there are collisions with other trait methods on MyClass in %s on line %d
|