declare(strict_types=1);
function process(object $o): void {
echo "process() OK";
}
process(new class {}); // OK
process("not object"); // TypeError
/*
run:
ERROR!
process() OK
Fatal error: Uncaught TypeError: process(): Argument #1 ($o) must be of type object, string given
*/