instanceof With Variables¶
It is possible to compare the type of two objects with instanceof: PHP uses the class of the second operand, or the name of the class passed as a string.
Here, note that the cast operator (object) creates stdClass when applied to array.