Object Is Not A Type

<?php

class a {}

$a = new A;
var_dump($a instanceof object); // false
var_dump(is_object($a));        // true

Such situations always make me smile, yet I am certain several of us will loose time on such a mistake. object is a type that can be used with argument, returntypes and properties, but not with instanceof. It is a bit more obvious with integer or string in the instanceof.

See Also

PHP Features

Last updated: 14 July 2026