I'm thoroughly confused as to why php's instanceof
operator insists that the LVALUE here is not an instance of the defined class when get_class
says that it is.
class WhereIn {
public function __construct($args) {
echo "is instanceof: " . ($args[0] instanceof ActiveRecordField) . EOL;
echo "get class: " . get_class($args[0]) . EOL;
}
}
The output from this method is:
is instanceof:
get class: ActiveRecordField
For reference, I'm using PHP 5.6.9.
If you use namespaces in your code, you need to provide it directly:
if ($args[0] instanceof ActiveRecordField) // False
if ($args[0] instanceof \MyCompany\Classes\ActiveRecordField) // True
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With