Your IP : 216.73.216.48


Current Path : /hdd/hdd21/main/php/php-7.3.1/Zend/tests/traits/
Upload File :
Current File : //hdd/hdd21/main/php/php-7.3.1/Zend/tests/traits/language010.phpt

--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