diff options
| author | Nikita Popov <nikita.ppv@gmail.com> | 2017-12-19 22:16:45 +0100 |
|---|---|---|
| committer | Nikita Popov <nikita.ppv@gmail.com> | 2017-12-19 22:16:45 +0100 |
| commit | b6131364f95af68159b1c17ab48f9523e439cb65 (patch) | |
| tree | 460004998061b52d52bd0d35a282d8da2c4928de /Zend/zend_compile.c | |
| parent | fc46c4b1061f54246a754dd7a32a41902062e652 (diff) | |
| download | php-git-b6131364f95af68159b1c17ab48f9523e439cb65.tar.gz | |
Return false for instanceof on literal
Diffstat (limited to 'Zend/zend_compile.c')
| -rw-r--r-- | Zend/zend_compile.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index a032188e11..63f9d57e76 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -7463,8 +7463,10 @@ void zend_compile_instanceof(znode *result, zend_ast *ast) /* {{{ */ zend_compile_expr(&obj_node, obj_ast); if (obj_node.op_type == IS_CONST) { - zend_error_noreturn(E_COMPILE_ERROR, - "instanceof expects an object instance, constant given"); + zend_do_free(&obj_node); + result->op_type = IS_CONST; + ZVAL_FALSE(&result->u.constant); + return; } zend_compile_class_ref_ex(&class_node, class_ast, |
