MFH: Bugfix# 39435: 'foo' instanceof bar gives invalid opcode error

This commit is contained in:
Sara Golemon 2006-12-12 23:25:23 +00:00
parent 18edb61440
commit db87e11e6b

View File

@ -3627,6 +3627,10 @@ void zend_do_instanceof(znode *result, znode *expr, znode *class_znode, int type
}
}
if (expr->op_type == IS_CONST) {
zend_error(E_COMPILE_ERROR, "instanceof expects an object instance, constant given");
}
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_INSTANCEOF;
opline->result.op_type = IS_TMP_VAR;