diff options
Diffstat (limited to 'Zend/zend_operators.c')
-rw-r--r-- | Zend/zend_operators.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index 30d7e3747e..cfa40d50bc 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -1047,6 +1047,19 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2) { zval op1_copy, op2_copy; + if ((op1->type == IS_NULL && op2->type == IS_STRING) + || (op2->type == IS_NULL && op1->type == IS_STRING)) { + if (op1->type == IS_NULL) { + result->type = IS_LONG; + result->value.lval = zend_binary_strcmp("", 0, op2->value.str.val, op2->value.str.len); + return SUCCESS; + } else { + result->type = IS_LONG; + result->value.lval = zend_binary_strcmp(op1->value.str.val, op1->value.str.len, "", 0); + return SUCCESS; + } + } + if (op1->type == IS_STRING && op2->type == IS_STRING) { zendi_smart_strcmp(result, op1, op2); return SUCCESS; |