bug64235b.phpt 645 B

1234567891011121314151617181920212223242526272829303132333435
  1. --TEST--
  2. Bug #64235 (Insteadof not work for class method in 5.4.11)
  3. --FILE--
  4. <?php
  5. class TestParentClass
  6. {
  7. public function method()
  8. {
  9. print_r('Parent method');
  10. print "\n";
  11. }
  12. }
  13. trait TestTrait
  14. {
  15. public function method()
  16. {
  17. print_r('Trait method');
  18. print "\n";
  19. }
  20. }
  21. class TestChildClass extends TestParentClass
  22. {
  23. use TestTrait
  24. {
  25. TestTrait::method as methodAlias;
  26. TestParentClass::method as TestParent;
  27. }
  28. }
  29. ?>
  30. --EXPECTF--
  31. Fatal error: Class TestParentClass is not a trait, Only traits may be used in 'as' and 'insteadof' statements in %sbug64235b.php on line %d