abstract_by_interface_001.phpt 600 B

123456789101112131415161718192021222324252627282930313233
  1. --TEST--
  2. ZE2 An abstract method may not be called
  3. --FILE--
  4. <?php
  5. class Root {
  6. }
  7. interface MyInterface
  8. {
  9. function MyInterfaceFunc();
  10. }
  11. abstract class Derived extends Root implements MyInterface {
  12. }
  13. class Leaf extends Derived
  14. {
  15. function MyInterfaceFunc() {}
  16. }
  17. var_dump(new Leaf);
  18. class Fails extends Root implements MyInterface {
  19. }
  20. ?>
  21. ===DONE===
  22. --EXPECTF--
  23. object(Leaf)#%d (0) {
  24. }
  25. Fatal error: Class Fails contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (MyInterface::MyInterfaceFunc) in %sabstract_by_interface_001.php on line %d