alias-semantics02.phpt 404 B

12345678910111213141516171819202122232425
  1. --TEST--
  2. Semantic of alias operation is to provide an additional identifier for the
  3. method body of the original method.
  4. It should also work in case the method is fully qualified.
  5. --FILE--
  6. <?php
  7. error_reporting(E_ALL);
  8. trait THello {
  9. public function a() {
  10. echo 'A';
  11. }
  12. }
  13. class TraitsTest {
  14. use THello { THello::a as b; }
  15. }
  16. $test = new TraitsTest();
  17. $test->a();
  18. $test->b();
  19. ?>
  20. --EXPECT--
  21. AA