1
0
mirror of https://github.com/php/php-src.git synced 2026-03-30 20:22:36 +02:00
Files
archived-php-src/Zend/tests/bug39003.phpt
DanielEScherzer ea297654f4 Zend/*: fix a bunch of typos (GH-16017)
* Zend/*: fix a bunch of typos

* Zend/tests/try/try_catch_finally_005.phpt: update string length
2024-09-24 10:55:21 +02:00

28 lines
526 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("__autoload($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