alias-semantics.phpt 337 B

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