1--TEST-- 2Bug #39003 (__autoload() is called for type hinting) 3--FILE-- 4<?php 5 6class ClassName 7{ 8 public $var = 'bla'; 9} 10 11function test (OtherClassName $object) { } 12 13function __autoload($class) 14{ 15 var_dump("__autload($class)"); 16} 17 18$obj = new ClassName; 19test($obj); 20 21echo "Done\n"; 22?> 23--EXPECTF-- 24Fatal error: Uncaught TypeError: 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:%d 25Stack trace: 26#0 %s(%d): test(Object(ClassName)) 27#1 {main} 28 thrown in %s on line %d 29