interfaces_002.phpt 657 B

1234567891011121314151617181920212223242526
  1. --TEST--
  2. ZE2 interface with an unimplemented method
  3. --FILE--
  4. <?php
  5. interface ThrowableInterface {
  6. public function getMessage();
  7. public function getErrno();
  8. }
  9. class Exception_foo implements ThrowableInterface {
  10. public $foo = "foo";
  11. public function getMessage() {
  12. return $this->foo;
  13. }
  14. }
  15. // this should die -- Exception class must be abstract...
  16. $foo = new Exception_foo;
  17. echo "Message: " . $foo->getMessage() . "\n";
  18. ?>
  19. ===DONE===
  20. --EXPECTF--
  21. Fatal error: Class Exception_foo contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (ThrowableInterface::getErrno) in %s on line %d