From: Sara Golemon Date: Tue, 12 Dec 2006 23:25:23 +0000 (+0000) Subject: MFH: Bugfix# 39435: 'foo' instanceof bar gives invalid opcode error X-Git-Tag: php-5.2.1RC1~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=db87e11e6b1ecb4a50224788c251be2c17ef940a;p=php MFH: Bugfix# 39435: 'foo' instanceof bar gives invalid opcode error --- diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 612f523253..43623e200e 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -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;