php-src/Zend/tests/bug39003.phpt
Aaron Piotrowski 110e0a5a2c Merge branch 'master' into throwable-interface
# Conflicts:
#	Zend/zend_language_scanner.c
#	Zend/zend_language_scanner.l
#	ext/simplexml/tests/SimpleXMLElement_xpath.phpt
2015-06-14 18:53:11 -05:00

29 lines
557 B
PHP

--TEST--
Bug #39003 (__autoload() is called for type hinting)
--FILE--
<?php
class ClassName
{
public $var = 'bla';
}
function test (OtherClassName $object) { }
function __autoload($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