2006-10-02 11:09:52 +00:00
|
|
|
--TEST--
|
2019-01-30 12:35:36 +00:00
|
|
|
Bug #39003 (autoloader is called for type hinting)
|
2006-10-02 11:09:52 +00:00
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
|
|
|
|
class ClassName
|
|
|
|
{
|
2020-02-03 21:52:20 +00:00
|
|
|
public $var = 'bla';
|
2006-10-02 11:09:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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";
|
|
|
|
?>
|
2018-09-16 17:16:42 +00:00
|
|
|
--EXPECTF--
|
2020-02-25 19:58:33 +00:00
|
|
|
Fatal error: Uncaught TypeError: test(): Argument #1 ($object) must be of type OtherClassName, ClassName given, called 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
|