interfaces_003.phpt 448 B

1234567891011121314151617181920212223242526
  1. --TEST--
  2. ZE2 interface and __construct
  3. --FILE--
  4. <?php
  5. class MyObject {}
  6. interface MyInterface
  7. {
  8. public function __construct(MyObject $o);
  9. }
  10. class MyTestClass implements MyInterface
  11. {
  12. public function __construct(MyObject $o)
  13. {
  14. }
  15. }
  16. $obj = new MyTestClass;
  17. ?>
  18. ===DONE===
  19. --EXPECTF--
  20. Catchable fatal error: Argument 1 passed to MyTestClass::__construct() must be an instance of MyObject, none given, called in %sinterfaces_003.php on line %d