Skip to content

Commit db87e11

Browse files
committed
MFH: Bugfix# 39435: 'foo' instanceof bar gives invalid opcode error
1 parent 18edb61 commit db87e11

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Zend/zend_compile.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3627,6 +3627,10 @@ void zend_do_instanceof(znode *result, znode *expr, znode *class_znode, int type
36273627
}
36283628
}
36293629

3630+
if (expr->op_type == IS_CONST) {
3631+
zend_error(E_COMPILE_ERROR, "instanceof expects an object instance, constant given");
3632+
}
3633+
36303634
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
36313635
opline->opcode = ZEND_INSTANCEOF;
36323636
opline->result.op_type = IS_TMP_VAR;

0 commit comments

Comments
 (0)