2006-10-02 11:09:52 +00:00
--TEST--
Bug #39003 (__autoload() is called for type hinting)
--FILE--
<?php
class ClassName
{
public $var = 'bla';
}
function test (OtherClassName $object) { }
2017-01-30 21:28:17 +00:00
spl_autoload_register(function ($class) {
2006-10-02 11:09:52 +00:00
var_dump("__autload($class)");
2017-01-30 21:28:17 +00:00
});
2006-10-02 11:09:52 +00:00
$obj = new ClassName;
test($obj);
echo "Done\n";
?>
--EXPECTF--
2015-05-17 22:31:43 +00:00
Fatal 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
2015-05-17 16:59:34 +00:00
Stack trace:
2015-05-17 19:49:53 +00:00
#0 %s(%d): test(Object(ClassName))
2015-05-17 16:59:34 +00:00
#1 {main}
thrown in %s on line %d