1--TEST-- 2Bug #42802 (Namespace not supported in types) 3--FILE-- 4<?php 5namespace foo; 6 7class bar { 8} 9 10function test1(bar $bar) { 11 echo "ok\n"; 12} 13 14function test2(\foo\bar $bar) { 15 echo "ok\n"; 16} 17function test3(\foo\bar $bar) { 18 echo "ok\n"; 19} 20function test4(\Exception $e) { 21 echo "ok\n"; 22} 23function test5(\bar $bar) { 24 echo "bug\n"; 25} 26 27$x = new bar(); 28$y = new \Exception(); 29test1($x); 30test2($x); 31test3($x); 32test4($y); 33test5($x); 34--EXPECTF-- 35ok 36ok 37ok 38ok 39 40Fatal error: Uncaught TypeError: Argument 1 passed to foo\test5() must be an instance of bar, instance of foo\bar given, called in %sbug42802.php on line %d and defined in %sbug42802.php:%d 41Stack trace: 42#0 %s(%d): foo\test5(Object(foo\bar)) 43#1 {main} 44 thrown in %sbug42802.php on line %d 45