bug39003.phpt 471 B

123456789101112131415161718192021222324
  1. --TEST--
  2. Bug #39003 (__autoload() is called for type hinting)
  3. --FILE--
  4. <?php
  5. class ClassName
  6. {
  7. public $var = 'bla';
  8. }
  9. function test (OtherClassName $object) { }
  10. function __autoload($class)
  11. {
  12. var_dump("__autload($class)");
  13. }
  14. $obj = new ClassName;
  15. test($obj);
  16. echo "Done\n";
  17. ?>
  18. --EXPECTF--
  19. Catchable fatal error: Argument 1 passed to test() must be an instance of OtherClassName, instance of ClassName given, called in %s on line %d and defined in %s on line %d