instanceof is smart

<?php
$a
="foo";
var_dump($a instanceof stdClass);
var_dump("foo" instanceof stdClass);
?>

bool(false)
PHP Fatal error:  instanceof expects an object instance, constant given in Command line code on line 1

If instanceof expects an object instance why does it accept a string variable? Well, I think that's actually good because why error if not necessary. On the other hand, if it accepts a string variable why does it fatal on a string constant? WTF.

Comments

it's fairly simple string

it's fairly simple

string constant != variable