Lines Matching refs:op2
755 ZEND_API int add_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in add_function()
761 switch (TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2))) { in add_function()
763 long lval = Z_LVAL_P(op1) + Z_LVAL_P(op2); in add_function()
766 if ((Z_LVAL_P(op1) & LONG_SIGN_MASK) == (Z_LVAL_P(op2) & LONG_SIGN_MASK) in add_function()
769 ZVAL_DOUBLE(result, (double) Z_LVAL_P(op1) + (double) Z_LVAL_P(op2)); in add_function()
777 ZVAL_DOUBLE(result, ((double)Z_LVAL_P(op1)) + Z_DVAL_P(op2)); in add_function()
781 ZVAL_DOUBLE(result, Z_DVAL_P(op1) + ((double)Z_LVAL_P(op2))); in add_function()
785 ZVAL_DOUBLE(result, Z_DVAL_P(op1) + Z_DVAL_P(op2)); in add_function()
791 if ((result == op1) && (result == op2)) { in add_function()
799 …zend_hash_merge(Z_ARRVAL_P(result), Z_ARRVAL_P(op2), (void (*)(void *pData)) zval_add_ref, (void *… in add_function()
806 zendi_convert_scalar_to_number(op2, op2_copy, result); in add_function()
817 ZEND_API int sub_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in sub_function()
823 switch (TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2))) { in sub_function()
825 long lval = Z_LVAL_P(op1) - Z_LVAL_P(op2); in sub_function()
828 if ((Z_LVAL_P(op1) & LONG_SIGN_MASK) != (Z_LVAL_P(op2) & LONG_SIGN_MASK) in sub_function()
831 ZVAL_DOUBLE(result, (double) Z_LVAL_P(op1) - (double) Z_LVAL_P(op2)); in sub_function()
839 ZVAL_DOUBLE(result, ((double)Z_LVAL_P(op1)) - Z_DVAL_P(op2)); in sub_function()
843 ZVAL_DOUBLE(result, Z_DVAL_P(op1) - ((double)Z_LVAL_P(op2))); in sub_function()
847 ZVAL_DOUBLE(result, Z_DVAL_P(op1) - Z_DVAL_P(op2)); in sub_function()
853 zendi_convert_scalar_to_number(op2, op2_copy, result); in sub_function()
864 ZEND_API int mul_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in mul_function()
870 switch (TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2))) { in mul_function()
874 …ZEND_SIGNED_MULTIPLY_LONG(Z_LVAL_P(op1),Z_LVAL_P(op2), Z_LVAL_P(result),Z_DVAL_P(result),overflow); in mul_function()
880 ZVAL_DOUBLE(result, ((double)Z_LVAL_P(op1)) * Z_DVAL_P(op2)); in mul_function()
884 ZVAL_DOUBLE(result, Z_DVAL_P(op1) * ((double)Z_LVAL_P(op2))); in mul_function()
888 ZVAL_DOUBLE(result, Z_DVAL_P(op1) * Z_DVAL_P(op2)); in mul_function()
894 zendi_convert_scalar_to_number(op2, op2_copy, result); in mul_function()
905 ZEND_API int div_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in div_function()
911 switch (TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2))) { in div_function()
913 if (Z_LVAL_P(op2) == 0) { in div_function()
917 } else if (Z_LVAL_P(op2) == -1 && Z_LVAL_P(op1) == LONG_MIN) { in div_function()
922 if (Z_LVAL_P(op1) % Z_LVAL_P(op2) == 0) { /* integer */ in div_function()
923 ZVAL_LONG(result, Z_LVAL_P(op1) / Z_LVAL_P(op2)); in div_function()
925 ZVAL_DOUBLE(result, ((double) Z_LVAL_P(op1)) / Z_LVAL_P(op2)); in div_function()
930 if (Z_LVAL_P(op2) == 0) { in div_function()
935 ZVAL_DOUBLE(result, Z_DVAL_P(op1) / (double)Z_LVAL_P(op2)); in div_function()
939 if (Z_DVAL_P(op2) == 0) { in div_function()
944 ZVAL_DOUBLE(result, (double)Z_LVAL_P(op1) / Z_DVAL_P(op2)); in div_function()
948 if (Z_DVAL_P(op2) == 0) { in div_function()
953 ZVAL_DOUBLE(result, Z_DVAL_P(op1) / Z_DVAL_P(op2)); in div_function()
959 zendi_convert_scalar_to_number(op2, op2_copy, result); in div_function()
970 ZEND_API int mod_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in mod_function()
977 zendi_convert_to_long(op2, op2_copy, result); in mod_function()
979 if (Z_LVAL_P(op2) == 0) { in mod_function()
985 if (Z_LVAL_P(op2) == -1) { in mod_function()
991 ZVAL_LONG(result, op1_lval % Z_LVAL_P(op2)); in mod_function()
996 ZEND_API int boolean_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in boolean_xor_function()
1003 zendi_convert_to_boolean(op2, op2_copy, result); in boolean_xor_function()
1004 ZVAL_BOOL(result, op1_lval ^ Z_LVAL_P(op2)); in boolean_xor_function()
1047 ZEND_API int bitwise_or_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in bitwise_or_function()
1052 if (Z_TYPE_P(op1) == IS_STRING && Z_TYPE_P(op2) == IS_STRING) { in bitwise_or_function()
1057 if (Z_STRLEN_P(op1) >= Z_STRLEN_P(op2)) { in bitwise_or_function()
1059 shorter = op2; in bitwise_or_function()
1061 longer = op2; in bitwise_or_function()
1080 zendi_convert_to_long(op2, op2_copy, result); in bitwise_or_function()
1082 ZVAL_LONG(result, op1_lval | Z_LVAL_P(op2)); in bitwise_or_function()
1087 ZEND_API int bitwise_and_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in bitwise_and_function()
1092 if (Z_TYPE_P(op1) == IS_STRING && Z_TYPE_P(op2) == IS_STRING) { in bitwise_and_function()
1097 if (Z_STRLEN_P(op1) >= Z_STRLEN_P(op2)) { in bitwise_and_function()
1099 shorter = op2; in bitwise_and_function()
1101 longer = op2; in bitwise_and_function()
1122 zendi_convert_to_long(op2, op2_copy, result); in bitwise_and_function()
1124 ZVAL_LONG(result, op1_lval & Z_LVAL_P(op2)); in bitwise_and_function()
1129 ZEND_API int bitwise_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in bitwise_xor_function()
1134 if (Z_TYPE_P(op1) == IS_STRING && Z_TYPE_P(op2) == IS_STRING) { in bitwise_xor_function()
1139 if (Z_STRLEN_P(op1) >= Z_STRLEN_P(op2)) { in bitwise_xor_function()
1141 shorter = op2; in bitwise_xor_function()
1143 longer = op2; in bitwise_xor_function()
1163 zendi_convert_to_long(op2, op2_copy, result); in bitwise_xor_function()
1165 ZVAL_LONG(result, op1_lval ^ Z_LVAL_P(op2)); in bitwise_xor_function()
1170 ZEND_API int shift_left_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in shift_left_function()
1177 zendi_convert_to_long(op2, op2_copy, result); in shift_left_function()
1178 ZVAL_LONG(result, op1_lval << Z_LVAL_P(op2)); in shift_left_function()
1183 ZEND_API int shift_right_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in shift_right_function()
1190 zendi_convert_to_long(op2, op2_copy, result); in shift_right_function()
1191 ZVAL_LONG(result, op1_lval >> Z_LVAL_P(op2)); in shift_right_function()
1197 ZEND_API int add_char_to_string(zval *result, const zval *op1, const zval *op2) /* {{{ */ in add_char_to_string() argument
1208 buf[length - 1] = (char) Z_LVAL_P(op2); in add_char_to_string()
1216 ZEND_API int add_string_to_string(zval *result, const zval *op1, const zval *op2) /* {{{ */ in add_string_to_string() argument
1218 int length = Z_STRLEN_P(op1) + Z_STRLEN_P(op2); in add_string_to_string()
1227 memcpy(buf + Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2)); in add_string_to_string()
1234 ZEND_API int concat_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in concat_function()
1242 if (Z_TYPE_P(op2) != IS_STRING) { in concat_function()
1243 zend_make_printable_zval(op2, &op2_copy, &use_copy2); in concat_function()
1256 op2 = &op2_copy; in concat_function()
1259 uint res_len = Z_STRLEN_P(op1) + Z_STRLEN_P(op2); in concat_function()
1261 if (Z_STRLEN_P(result) < 0 || (int) (Z_STRLEN_P(op1) + Z_STRLEN_P(op2)) < 0) { in concat_function()
1269 memcpy(Z_STRVAL_P(result)+Z_STRLEN_P(result), Z_STRVAL_P(op2), Z_STRLEN_P(op2)); in concat_function()
1273 int length = Z_STRLEN_P(op1) + Z_STRLEN_P(op2); in concat_function()
1276 if (Z_STRLEN_P(op1) < 0 || Z_STRLEN_P(op2) < 0 || (int) (Z_STRLEN_P(op1) + Z_STRLEN_P(op2)) < 0) { in concat_function()
1282 memcpy(buf + Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2)); in concat_function()
1290 zval_dtor(op2); in concat_function()
1296 ZEND_API int string_compare_function_ex(zval *result, zval *op1, zval *op2, zend_bool case_insensit… in string_compare_function_ex() argument
1304 if (Z_TYPE_P(op2) != IS_STRING) { in string_compare_function_ex()
1305 zend_make_printable_zval(op2, &op2_copy, &use_copy2); in string_compare_function_ex()
1312 op2 = &op2_copy; in string_compare_function_ex()
1316 ZVAL_LONG(result, zend_binary_zval_strcasecmp(op1, op2)); in string_compare_function_ex()
1318 ZVAL_LONG(result, zend_binary_zval_strcmp(op1, op2)); in string_compare_function_ex()
1325 zval_dtor(op2); in string_compare_function_ex()
1331 ZEND_API int string_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in string_compare_function()
1333 return string_compare_function_ex(result, op1, op2, 0 TSRMLS_CC); in string_compare_function()
1337 ZEND_API int string_case_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in string_case_compare_function()
1339 return string_compare_function_ex(result, op1, op2, 1 TSRMLS_CC); in string_case_compare_function()
1344 ZEND_API int string_locale_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in string_locale_compare_function()
1352 if (Z_TYPE_P(op2) != IS_STRING) { in string_locale_compare_function()
1353 zend_make_printable_zval(op2, &op2_copy, &use_copy2); in string_locale_compare_function()
1360 op2 = &op2_copy; in string_locale_compare_function()
1363 ZVAL_LONG(result, strcoll(Z_STRVAL_P(op1), Z_STRVAL_P(op2))); in string_locale_compare_function()
1369 zval_dtor(op2); in string_locale_compare_function()
1376 ZEND_API int numeric_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in numeric_compare_function()
1383 op2_copy = *op2; in numeric_compare_function()
1407 ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in compare_function()
1415 switch (TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2))) { in compare_function()
1417 ZVAL_LONG(result, Z_LVAL_P(op1)>Z_LVAL_P(op2)?1:(Z_LVAL_P(op1)<Z_LVAL_P(op2)?-1:0)); in compare_function()
1421 Z_DVAL_P(result) = Z_DVAL_P(op1) - (double)Z_LVAL_P(op2); in compare_function()
1426 Z_DVAL_P(result) = (double)Z_LVAL_P(op1) - Z_DVAL_P(op2); in compare_function()
1431 if (Z_DVAL_P(op1) == Z_DVAL_P(op2)) { in compare_function()
1434 Z_DVAL_P(result) = Z_DVAL_P(op1) - Z_DVAL_P(op2); in compare_function()
1440 zend_compare_arrays(result, op1, op2 TSRMLS_CC); in compare_function()
1448 ZVAL_LONG(result, Z_LVAL_P(op2) ? -1 : 0); in compare_function()
1456 ZVAL_LONG(result, ZEND_NORMALIZE_BOOL(Z_LVAL_P(op1) - Z_LVAL_P(op2))); in compare_function()
1460 zendi_smart_strcmp(result, op1, op2); in compare_function()
1464 ZVAL_LONG(result, zend_binary_strcmp("", 0, Z_STRVAL_P(op2), Z_STRLEN_P(op2))); in compare_function()
1481 if (Z_OBJ_HANDLER_P(op1,compare_objects) == Z_OBJ_HANDLER_P(op2,compare_objects)) { in compare_function()
1482 if (Z_OBJ_HANDLE_P(op1) == Z_OBJ_HANDLE_P(op2)) { in compare_function()
1487 ZVAL_LONG(result, Z_OBJ_HT_P(op1)->compare_objects(op1, op2 TSRMLS_CC)); in compare_function()
1496 ret = compare_function(result, op_free, op2 TSRMLS_CC); in compare_function()
1499 } else if (Z_TYPE_P(op2) != IS_OBJECT && Z_OBJ_HT_P(op1)->cast_object) { in compare_function()
1501 if (Z_OBJ_HT_P(op1)->cast_object(op1, op_free, Z_TYPE_P(op2) TSRMLS_CC) == FAILURE) { in compare_function()
1506 ret = compare_function(result, op_free, op2 TSRMLS_CC); in compare_function()
1511 if (Z_TYPE_P(op2) == IS_OBJECT) { in compare_function()
1512 if (Z_OBJ_HT_P(op2)->get) { in compare_function()
1513 op_free = Z_OBJ_HT_P(op2)->get(op2 TSRMLS_CC); in compare_function()
1517 } else if (Z_TYPE_P(op1) != IS_OBJECT && Z_OBJ_HT_P(op2)->cast_object) { in compare_function()
1519 if (Z_OBJ_HT_P(op2)->cast_object(op2, op_free, Z_TYPE_P(op1) TSRMLS_CC) == FAILURE) { in compare_function()
1534 zendi_convert_to_boolean(op2, op2_copy, result); in compare_function()
1535 ZVAL_LONG(result, Z_LVAL_P(op2) ? -1 : 0); in compare_function()
1537 } else if (Z_TYPE_P(op2) == IS_NULL) { in compare_function()
1542 zendi_convert_to_boolean(op2, op2_copy, result); in compare_function()
1543 ZVAL_LONG(result, ZEND_NORMALIZE_BOOL(Z_LVAL_P(op1) - Z_LVAL_P(op2))); in compare_function()
1545 } else if (Z_TYPE_P(op2) == IS_BOOL) { in compare_function()
1547 ZVAL_LONG(result, ZEND_NORMALIZE_BOOL(Z_LVAL_P(op1) - Z_LVAL_P(op2))); in compare_function()
1551 zendi_convert_scalar_to_number(op2, op2_copy, result); in compare_function()
1557 } else if (Z_TYPE_P(op2)==IS_ARRAY) { in compare_function()
1563 } else if (Z_TYPE_P(op2)==IS_OBJECT) { in compare_function()
1592 ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in is_identical_function()
1595 if (Z_TYPE_P(op1) != Z_TYPE_P(op2)) { in is_identical_function()
1606 Z_LVAL_P(result) = (Z_LVAL_P(op1) == Z_LVAL_P(op2)); in is_identical_function()
1609 Z_LVAL_P(result) = (Z_DVAL_P(op1) == Z_DVAL_P(op2)); in is_identical_function()
1612 Z_LVAL_P(result) = ((Z_STRLEN_P(op1) == Z_STRLEN_P(op2)) in is_identical_function()
1613 && (!memcmp(Z_STRVAL_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op1)))); in is_identical_function()
1616 Z_LVAL_P(result) = (Z_ARRVAL_P(op1) == Z_ARRVAL_P(op2) || in is_identical_function()
1617 …zend_hash_compare(Z_ARRVAL_P(op1), Z_ARRVAL_P(op2), (compare_func_t) hash_zval_identical_function,… in is_identical_function()
1620 if (Z_OBJ_HT_P(op1) == Z_OBJ_HT_P(op2)) { in is_identical_function()
1621 Z_LVAL_P(result) = (Z_OBJ_HANDLE_P(op1) == Z_OBJ_HANDLE_P(op2)); in is_identical_function()
1634 ZEND_API int is_not_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in is_not_identical_function()
1636 if (is_identical_function(result, op1, op2 TSRMLS_CC) == FAILURE) { in is_not_identical_function()
1644 ZEND_API int is_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in is_equal_function()
1646 if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) { in is_equal_function()
1654 ZEND_API int is_not_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in is_not_equal_function()
1656 if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) { in is_not_equal_function()
1664 ZEND_API int is_smaller_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in is_smaller_function()
1666 if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) { in is_smaller_function()
1674 ZEND_API int is_smaller_or_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in is_smaller_or_equal_function()
1676 if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) { in is_smaller_or_equal_function()