summaryrefslogtreecommitdiff
path: root/Zend/tests/bug39003.phpt
blob: f4f9e4d9b6531f7c979c5fe0038f34b69eb022f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--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()
#1 {main}
  thrown in %s on line %d