mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
960318ed95
Closes GH-5211
28 lines
525 B
PHP
28 lines
525 B
PHP
--TEST--
|
|
Bug #39003 (autoloader is called for type hinting)
|
|
--FILE--
|
|
<?php
|
|
|
|
class ClassName
|
|
{
|
|
public $var = 'bla';
|
|
}
|
|
|
|
function test (OtherClassName $object) { }
|
|
|
|
spl_autoload_register(function ($class) {
|
|
var_dump("__autload($class)");
|
|
});
|
|
|
|
$obj = new ClassName;
|
|
test($obj);
|
|
|
|
echo "Done\n";
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Uncaught TypeError: test(): Argument #1 ($object) must be of type OtherClassName, ClassName given, called in %s:%d
|
|
Stack trace:
|
|
#0 %s(%d): test(Object(ClassName))
|
|
#1 {main}
|
|
thrown in %s on line %d
|