Lines Matching refs:op2
810 ZEND_API int add_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in add_function()
816 switch (TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2))) { in add_function()
818 long lval = Z_LVAL_P(op1) + Z_LVAL_P(op2); in add_function()
821 if ((Z_LVAL_P(op1) & LONG_SIGN_MASK) == (Z_LVAL_P(op2) & LONG_SIGN_MASK) in add_function()
824 ZVAL_DOUBLE(result, (double) Z_LVAL_P(op1) + (double) Z_LVAL_P(op2)); in add_function()
832 ZVAL_DOUBLE(result, ((double)Z_LVAL_P(op1)) + Z_DVAL_P(op2)); in add_function()
836 ZVAL_DOUBLE(result, Z_DVAL_P(op1) + ((double)Z_LVAL_P(op2))); in add_function()
840 ZVAL_DOUBLE(result, Z_DVAL_P(op1) + Z_DVAL_P(op2)); in add_function()
846 if ((result == op1) && (result == op2)) { in add_function()
854 …zend_hash_merge(Z_ARRVAL_P(result), Z_ARRVAL_P(op2), (void (*)(void *pData)) zval_add_ref, (void *… in add_function()
863 zendi_convert_scalar_to_number(op2, op2_copy, result); in add_function()
874 ZEND_API int sub_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in sub_function()
880 switch (TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2))) { in sub_function()
882 long lval = Z_LVAL_P(op1) - Z_LVAL_P(op2); in sub_function()
885 if ((Z_LVAL_P(op1) & LONG_SIGN_MASK) != (Z_LVAL_P(op2) & LONG_SIGN_MASK) in sub_function()
888 ZVAL_DOUBLE(result, (double) Z_LVAL_P(op1) - (double) Z_LVAL_P(op2)); in sub_function()
896 ZVAL_DOUBLE(result, ((double)Z_LVAL_P(op1)) - Z_DVAL_P(op2)); in sub_function()
900 ZVAL_DOUBLE(result, Z_DVAL_P(op1) - ((double)Z_LVAL_P(op2))); in sub_function()
904 ZVAL_DOUBLE(result, Z_DVAL_P(op1) - Z_DVAL_P(op2)); in sub_function()
912 zendi_convert_scalar_to_number(op2, op2_copy, result); in sub_function()
923 ZEND_API int mul_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in mul_function()
929 switch (TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2))) { in mul_function()
933 …ZEND_SIGNED_MULTIPLY_LONG(Z_LVAL_P(op1),Z_LVAL_P(op2), Z_LVAL_P(result),Z_DVAL_P(result),overflow); in mul_function()
939 ZVAL_DOUBLE(result, ((double)Z_LVAL_P(op1)) * Z_DVAL_P(op2)); in mul_function()
943 ZVAL_DOUBLE(result, Z_DVAL_P(op1) * ((double)Z_LVAL_P(op2))); in mul_function()
947 ZVAL_DOUBLE(result, Z_DVAL_P(op1) * Z_DVAL_P(op2)); in mul_function()
955 zendi_convert_scalar_to_number(op2, op2_copy, result); in mul_function()
966 ZEND_API int pow_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in pow_function()
972 switch (TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2))) { in pow_function()
974 if (Z_LVAL_P(op2) >= 0) { in pow_function()
975 long l1 = 1, l2 = Z_LVAL_P(op1), i = Z_LVAL_P(op2); in pow_function()
1008 ZVAL_DOUBLE(result, pow((double)Z_LVAL_P(op1), (double)Z_LVAL_P(op2))); in pow_function()
1013 ZVAL_DOUBLE(result, pow((double)Z_LVAL_P(op1), Z_DVAL_P(op2))); in pow_function()
1017 ZVAL_DOUBLE(result, pow(Z_DVAL_P(op1), (double)Z_LVAL_P(op2))); in pow_function()
1021 ZVAL_DOUBLE(result, pow(Z_DVAL_P(op1), Z_DVAL_P(op2))); in pow_function()
1034 if (Z_TYPE_P(op2) == IS_ARRAY) { in pow_function()
1038 zendi_convert_scalar_to_number(op2, op2_copy, result); in pow_function()
1050 ZEND_API int div_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in div_function()
1056 switch (TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2))) { in div_function()
1058 if (Z_LVAL_P(op2) == 0) { in div_function()
1062 } else if (Z_LVAL_P(op2) == -1 && Z_LVAL_P(op1) == LONG_MIN) { in div_function()
1067 if (Z_LVAL_P(op1) % Z_LVAL_P(op2) == 0) { /* integer */ in div_function()
1068 ZVAL_LONG(result, Z_LVAL_P(op1) / Z_LVAL_P(op2)); in div_function()
1070 ZVAL_DOUBLE(result, ((double) Z_LVAL_P(op1)) / Z_LVAL_P(op2)); in div_function()
1075 if (Z_LVAL_P(op2) == 0) { in div_function()
1080 ZVAL_DOUBLE(result, Z_DVAL_P(op1) / (double)Z_LVAL_P(op2)); in div_function()
1084 if (Z_DVAL_P(op2) == 0) { in div_function()
1089 ZVAL_DOUBLE(result, (double)Z_LVAL_P(op1) / Z_DVAL_P(op2)); in div_function()
1093 if (Z_DVAL_P(op2) == 0) { in div_function()
1098 ZVAL_DOUBLE(result, Z_DVAL_P(op1) / Z_DVAL_P(op2)); in div_function()
1106 zendi_convert_scalar_to_number(op2, op2_copy, result); in div_function()
1117 ZEND_API int mod_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in mod_function()
1122 if (Z_TYPE_P(op1) != IS_LONG || Z_TYPE_P(op2) != IS_LONG) { in mod_function()
1127 zendi_convert_to_long(op2, op2_copy, result); in mod_function()
1132 if (Z_LVAL_P(op2) == 0) { in mod_function()
1138 if (Z_LVAL_P(op2) == -1) { in mod_function()
1144 ZVAL_LONG(result, op1_lval % Z_LVAL_P(op2)); in mod_function()
1149 ZEND_API int boolean_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in boolean_xor_function()
1154 if (Z_TYPE_P(op1) != IS_BOOL || Z_TYPE_P(op2) != IS_BOOL) { in boolean_xor_function()
1159 zendi_convert_to_boolean(op2, op2_copy, result); in boolean_xor_function()
1164 ZVAL_BOOL(result, op1_lval ^ Z_LVAL_P(op2)); in boolean_xor_function()
1215 ZEND_API int bitwise_or_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in bitwise_or_function()
1220 if (Z_TYPE_P(op1) == IS_STRING && Z_TYPE_P(op2) == IS_STRING) { in bitwise_or_function()
1225 if (Z_STRLEN_P(op1) >= Z_STRLEN_P(op2)) { in bitwise_or_function()
1227 shorter = op2; in bitwise_or_function()
1229 longer = op2; in bitwise_or_function()
1247 if (Z_TYPE_P(op1) != IS_LONG || Z_TYPE_P(op2) != IS_LONG) { in bitwise_or_function()
1252 zendi_convert_to_long(op2, op2_copy, result); in bitwise_or_function()
1257 ZVAL_LONG(result, op1_lval | Z_LVAL_P(op2)); in bitwise_or_function()
1262 ZEND_API int bitwise_and_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in bitwise_and_function()
1267 if (Z_TYPE_P(op1) == IS_STRING && Z_TYPE_P(op2) == IS_STRING) { in bitwise_and_function()
1272 if (Z_STRLEN_P(op1) >= Z_STRLEN_P(op2)) { in bitwise_and_function()
1274 shorter = op2; in bitwise_and_function()
1276 longer = op2; in bitwise_and_function()
1294 if (Z_TYPE_P(op1) != IS_LONG || Z_TYPE_P(op2) != IS_LONG) { in bitwise_and_function()
1299 zendi_convert_to_long(op2, op2_copy, result); in bitwise_and_function()
1304 ZVAL_LONG(result, op1_lval & Z_LVAL_P(op2)); in bitwise_and_function()
1309 ZEND_API int bitwise_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in bitwise_xor_function()
1314 if (Z_TYPE_P(op1) == IS_STRING && Z_TYPE_P(op2) == IS_STRING) { in bitwise_xor_function()
1319 if (Z_STRLEN_P(op1) >= Z_STRLEN_P(op2)) { in bitwise_xor_function()
1321 shorter = op2; in bitwise_xor_function()
1323 longer = op2; in bitwise_xor_function()
1341 if (Z_TYPE_P(op1) != IS_LONG || Z_TYPE_P(op2) != IS_LONG) { in bitwise_xor_function()
1346 zendi_convert_to_long(op2, op2_copy, result); in bitwise_xor_function()
1351 ZVAL_LONG(result, op1_lval ^ Z_LVAL_P(op2)); in bitwise_xor_function()
1356 ZEND_API int shift_left_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in shift_left_function()
1361 if (Z_TYPE_P(op1) != IS_LONG || Z_TYPE_P(op2) != IS_LONG) { in shift_left_function()
1366 zendi_convert_to_long(op2, op2_copy, result); in shift_left_function()
1371 ZVAL_LONG(result, op1_lval << Z_LVAL_P(op2)); in shift_left_function()
1376 ZEND_API int shift_right_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in shift_right_function()
1381 if (Z_TYPE_P(op1) != IS_LONG || Z_TYPE_P(op2) != IS_LONG) { in shift_right_function()
1386 zendi_convert_to_long(op2, op2_copy, result); in shift_right_function()
1391 ZVAL_LONG(result, op1_lval >> Z_LVAL_P(op2)); in shift_right_function()
1397 ZEND_API int add_char_to_string(zval *result, const zval *op1, const zval *op2) /* {{{ */ in add_char_to_string() argument
1408 buf[length - 1] = (char) Z_LVAL_P(op2); in add_char_to_string()
1416 ZEND_API int add_string_to_string(zval *result, const zval *op1, const zval *op2) /* {{{ */ in add_string_to_string() argument
1418 int length = Z_STRLEN_P(op1) + Z_STRLEN_P(op2); in add_string_to_string()
1427 memcpy(buf + Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2)); in add_string_to_string()
1434 ZEND_API int concat_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in concat_function()
1439 if (Z_TYPE_P(op1) != IS_STRING || Z_TYPE_P(op2) != IS_STRING) { in concat_function()
1445 if (Z_TYPE_P(op2) != IS_STRING) { in concat_function()
1446 zend_make_printable_zval(op2, &op2_copy, &use_copy2); in concat_function()
1460 op2 = &op2_copy; in concat_function()
1463 uint res_len = Z_STRLEN_P(op1) + Z_STRLEN_P(op2); in concat_function()
1465 if (Z_STRLEN_P(result) < 0 || (int) (Z_STRLEN_P(op1) + Z_STRLEN_P(op2)) < 0) { in concat_function()
1473 memcpy(Z_STRVAL_P(result)+Z_STRLEN_P(result), Z_STRVAL_P(op2), Z_STRLEN_P(op2)); in concat_function()
1477 int length = Z_STRLEN_P(op1) + Z_STRLEN_P(op2); in concat_function()
1480 if (Z_STRLEN_P(op1) < 0 || Z_STRLEN_P(op2) < 0 || (int) (Z_STRLEN_P(op1) + Z_STRLEN_P(op2)) < 0) { in concat_function()
1486 memcpy(buf + Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2)); in concat_function()
1494 zval_dtor(op2); in concat_function()
1500 ZEND_API int string_compare_function_ex(zval *result, zval *op1, zval *op2, zend_bool case_insensit… in string_compare_function_ex() argument
1508 if (Z_TYPE_P(op2) != IS_STRING) { in string_compare_function_ex()
1509 zend_make_printable_zval(op2, &op2_copy, &use_copy2); in string_compare_function_ex()
1516 op2 = &op2_copy; in string_compare_function_ex()
1520 ZVAL_LONG(result, zend_binary_zval_strcasecmp(op1, op2)); in string_compare_function_ex()
1522 ZVAL_LONG(result, zend_binary_zval_strcmp(op1, op2)); in string_compare_function_ex()
1529 zval_dtor(op2); in string_compare_function_ex()
1535 ZEND_API int string_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in string_compare_function()
1537 return string_compare_function_ex(result, op1, op2, 0 TSRMLS_CC); in string_compare_function()
1541 ZEND_API int string_case_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in string_case_compare_function()
1543 return string_compare_function_ex(result, op1, op2, 1 TSRMLS_CC); in string_case_compare_function()
1548 ZEND_API int string_locale_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in string_locale_compare_function()
1556 if (Z_TYPE_P(op2) != IS_STRING) { in string_locale_compare_function()
1557 zend_make_printable_zval(op2, &op2_copy, &use_copy2); in string_locale_compare_function()
1564 op2 = &op2_copy; in string_locale_compare_function()
1567 ZVAL_LONG(result, strcoll(Z_STRVAL_P(op1), Z_STRVAL_P(op2))); in string_locale_compare_function()
1573 zval_dtor(op2); in string_locale_compare_function()
1580 ZEND_API int numeric_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in numeric_compare_function()
1587 op2_copy = *op2; in numeric_compare_function()
1611 ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in compare_function()
1619 switch (TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2))) { in compare_function()
1621 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()
1625 Z_DVAL_P(result) = Z_DVAL_P(op1) - (double)Z_LVAL_P(op2); in compare_function()
1630 Z_DVAL_P(result) = (double)Z_LVAL_P(op1) - Z_DVAL_P(op2); in compare_function()
1635 if (Z_DVAL_P(op1) == Z_DVAL_P(op2)) { in compare_function()
1638 Z_DVAL_P(result) = Z_DVAL_P(op1) - Z_DVAL_P(op2); in compare_function()
1644 zend_compare_arrays(result, op1, op2 TSRMLS_CC); in compare_function()
1652 ZVAL_LONG(result, Z_LVAL_P(op2) ? -1 : 0); in compare_function()
1660 ZVAL_LONG(result, ZEND_NORMALIZE_BOOL(Z_LVAL_P(op1) - Z_LVAL_P(op2))); in compare_function()
1664 zendi_smart_strcmp(result, op1, op2); in compare_function()
1668 ZVAL_LONG(result, zend_binary_strcmp("", 0, Z_STRVAL_P(op2), Z_STRLEN_P(op2))); in compare_function()
1685 return Z_OBJ_HANDLER_P(op1, compare)(result, op1, op2 TSRMLS_CC); in compare_function()
1686 } else if (Z_TYPE_P(op2) == IS_OBJECT && Z_OBJ_HANDLER_P(op2, compare)) { in compare_function()
1687 return Z_OBJ_HANDLER_P(op2, compare)(result, op1, op2 TSRMLS_CC); in compare_function()
1690 if (Z_TYPE_P(op1) == IS_OBJECT && Z_TYPE_P(op2) == IS_OBJECT) { in compare_function()
1691 if (Z_OBJ_HANDLE_P(op1) == Z_OBJ_HANDLE_P(op2)) { in compare_function()
1696 if (Z_OBJ_HANDLER_P(op1, compare_objects) == Z_OBJ_HANDLER_P(op2, compare_objects)) { in compare_function()
1697 ZVAL_LONG(result, Z_OBJ_HANDLER_P(op1, compare_objects)(op1, op2 TSRMLS_CC)); in compare_function()
1704 ret = compare_function(result, op_free, op2 TSRMLS_CC); in compare_function()
1707 } else if (Z_TYPE_P(op2) != IS_OBJECT && Z_OBJ_HT_P(op1)->cast_object) { in compare_function()
1709 if (Z_OBJ_HT_P(op1)->cast_object(op1, op_free, Z_TYPE_P(op2) TSRMLS_CC) == FAILURE) { in compare_function()
1714 ret = compare_function(result, op_free, op2 TSRMLS_CC); in compare_function()
1719 if (Z_TYPE_P(op2) == IS_OBJECT) { in compare_function()
1720 if (Z_OBJ_HT_P(op2)->get) { in compare_function()
1721 op_free = Z_OBJ_HT_P(op2)->get(op2 TSRMLS_CC); in compare_function()
1725 } else if (Z_TYPE_P(op1) != IS_OBJECT && Z_OBJ_HT_P(op2)->cast_object) { in compare_function()
1727 if (Z_OBJ_HT_P(op2)->cast_object(op2, op_free, Z_TYPE_P(op1) TSRMLS_CC) == FAILURE) { in compare_function()
1742 zendi_convert_to_boolean(op2, op2_copy, result); in compare_function()
1743 ZVAL_LONG(result, Z_LVAL_P(op2) ? -1 : 0); in compare_function()
1745 } else if (Z_TYPE_P(op2) == IS_NULL) { in compare_function()
1750 zendi_convert_to_boolean(op2, op2_copy, result); in compare_function()
1751 ZVAL_LONG(result, ZEND_NORMALIZE_BOOL(Z_LVAL_P(op1) - Z_LVAL_P(op2))); in compare_function()
1753 } else if (Z_TYPE_P(op2) == IS_BOOL) { in compare_function()
1755 ZVAL_LONG(result, ZEND_NORMALIZE_BOOL(Z_LVAL_P(op1) - Z_LVAL_P(op2))); in compare_function()
1759 zendi_convert_scalar_to_number(op2, op2_copy, result); in compare_function()
1765 } else if (Z_TYPE_P(op2)==IS_ARRAY) { in compare_function()
1771 } else if (Z_TYPE_P(op2)==IS_OBJECT) { in compare_function()
1800 ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in is_identical_function()
1803 if (Z_TYPE_P(op1) != Z_TYPE_P(op2)) { in is_identical_function()
1814 Z_LVAL_P(result) = (Z_LVAL_P(op1) == Z_LVAL_P(op2)); in is_identical_function()
1817 Z_LVAL_P(result) = (Z_DVAL_P(op1) == Z_DVAL_P(op2)); in is_identical_function()
1820 Z_LVAL_P(result) = ((Z_STRLEN_P(op1) == Z_STRLEN_P(op2)) in is_identical_function()
1821 && (!memcmp(Z_STRVAL_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op1)))); in is_identical_function()
1824 Z_LVAL_P(result) = (Z_ARRVAL_P(op1) == Z_ARRVAL_P(op2) || in is_identical_function()
1825 …zend_hash_compare(Z_ARRVAL_P(op1), Z_ARRVAL_P(op2), (compare_func_t) hash_zval_identical_function,… in is_identical_function()
1828 if (Z_OBJ_HT_P(op1) == Z_OBJ_HT_P(op2)) { in is_identical_function()
1829 Z_LVAL_P(result) = (Z_OBJ_HANDLE_P(op1) == Z_OBJ_HANDLE_P(op2)); in is_identical_function()
1842 ZEND_API int is_not_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in is_not_identical_function()
1844 if (is_identical_function(result, op1, op2 TSRMLS_CC) == FAILURE) { in is_not_identical_function()
1852 ZEND_API int is_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in is_equal_function()
1854 if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) { in is_equal_function()
1862 ZEND_API int is_not_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in is_not_equal_function()
1864 if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) { in is_not_equal_function()
1872 ZEND_API int is_smaller_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in is_smaller_function()
1874 if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) { in is_smaller_function()
1882 ZEND_API int is_smaller_or_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in is_smaller_or_equal_function()
1884 if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) { in is_smaller_or_equal_function()
2051 zval *op2; in increment_function() local
2055 MAKE_STD_ZVAL(op2); in increment_function()
2056 ZVAL_LONG(op2, 1); in increment_function()
2057 res = Z_OBJ_HANDLER_P(op1, do_operation)(ZEND_ADD, op1, op1, op2 TSRMLS_CC); in increment_function()
2058 zval_ptr_dtor(&op2); in increment_function()
2111 zval *op2; in decrement_function() local
2115 MAKE_STD_ZVAL(op2); in decrement_function()
2116 ZVAL_LONG(op2, 1); in decrement_function()
2117 res = Z_OBJ_HANDLER_P(op1, do_operation)(ZEND_SUB, op1, op1, op2 TSRMLS_CC); in decrement_function()
2118 zval_ptr_dtor(&op2); in decrement_function()