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
Nikita Popov 0dfd918ee7 Remove support for __autoload()
There are probably some improvements we can do to the SPL
implementation now that __autoload() is gone. In particular having
EG(autoload_func) as a property zend function, rather than a simple
callback probably doesn't make sense.
2019-01-30 14:00:16 +01:00

28 lines
568 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: 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
Stack trace:
#0 %s(%d): test(Object(ClassName))
#1 {main}
thrown in %s on line %d