1--TEST-- 2Reflecting object type hint 3--FILE-- 4<?php 5 6interface One { 7 public function a(object $obj); 8} 9 10class Two implements One { 11 public function a(object $obj) {} 12} 13 14function a(object $obj) {} 15 16$typeHintOne = (new ReflectionClass(One::class))->getMethod('a')->getParameters()[0]->getType(); 17var_dump($typeHintOne->isBuiltin(), $typeHintOne->getName()); 18 19$typeHintTwo = (new ReflectionClass(Two::class))->getMethod('a')->getParameters()[0]->getType(); 20var_dump($typeHintTwo->isBuiltin(), $typeHintTwo->getName()); 21 22$typeHinta = (new ReflectionFunction('a'))->getParameters()[0]->getType(); 23var_dump($typeHinta->isBuiltin(), $typeHinta->getName()); 24?> 25--EXPECT-- 26bool(true) 27string(6) "object" 28bool(true) 29string(6) "object" 30bool(true) 31string(6) "object" 32