interfaces_002.phpt 718 B

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