Lines Matching refs:op2
260 #define convert_op1_op2_long(op1, op1_lval, op2, op2_lval, result, op, op_func) \ argument
283 if (UNEXPECTED(Z_TYPE_P(op2) != IS_LONG)) { \
284 if (Z_ISREF_P(op2)) { \
285 op2 = Z_REFVAL_P(op2); \
286 if (Z_TYPE_P(op2) == IS_LONG) { \
287 op2_lval = Z_LVAL_P(op2); \
292 op2_lval = _zval_get_long_func_noisy(op2); \
300 op2_lval = Z_LVAL_P(op2); \
897 ZEND_API int ZEND_FASTCALL add_function(zval *result, zval *op1, zval *op2) /* {{{ */ in add_function() argument
903 switch (TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2))) { in add_function()
905 fast_long_add_function(result, op1, op2); in add_function()
908 ZVAL_DOUBLE(result, ((double)Z_LVAL_P(op1)) + Z_DVAL_P(op2)); in add_function()
912 ZVAL_DOUBLE(result, Z_DVAL_P(op1) + ((double)Z_LVAL_P(op2))); in add_function()
916 ZVAL_DOUBLE(result, Z_DVAL_P(op1) + Z_DVAL_P(op2)); in add_function()
920 if ((result == op1) && (result == op2)) { in add_function()
927 zend_hash_merge(Z_ARRVAL_P(result), Z_ARRVAL_P(op2), zval_add_ref, 0); in add_function()
933 } else if (Z_ISREF_P(op2)) { in add_function()
934 op2 = Z_REFVAL_P(op2); in add_function()
938 if (EXPECTED(op1 != op2)) { in add_function()
940 zendi_convert_scalar_to_number(op2, op2_copy, result, 0); in add_function()
943 op2 = op1; in add_function()
958 ZEND_API int ZEND_FASTCALL sub_function(zval *result, zval *op1, zval *op2) /* {{{ */ in sub_function() argument
964 switch (TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2))) { in sub_function()
966 fast_long_sub_function(result, op1, op2); in sub_function()
969 ZVAL_DOUBLE(result, ((double)Z_LVAL_P(op1)) - Z_DVAL_P(op2)); in sub_function()
973 ZVAL_DOUBLE(result, Z_DVAL_P(op1) - ((double)Z_LVAL_P(op2))); in sub_function()
977 ZVAL_DOUBLE(result, Z_DVAL_P(op1) - Z_DVAL_P(op2)); in sub_function()
983 } else if (Z_ISREF_P(op2)) { in sub_function()
984 op2 = Z_REFVAL_P(op2); in sub_function()
988 if (EXPECTED(op1 != op2)) { in sub_function()
990 zendi_convert_scalar_to_number(op2, op2_copy, result, 0); in sub_function()
993 op2 = op1; in sub_function()
1008 ZEND_API int ZEND_FASTCALL mul_function(zval *result, zval *op1, zval *op2) /* {{{ */ in mul_function() argument
1014 switch (TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2))) { in mul_function()
1018 …ZEND_SIGNED_MULTIPLY_LONG(Z_LVAL_P(op1),Z_LVAL_P(op2), Z_LVAL_P(result),Z_DVAL_P(result),overflow); in mul_function()
1024 ZVAL_DOUBLE(result, ((double)Z_LVAL_P(op1)) * Z_DVAL_P(op2)); in mul_function()
1028 ZVAL_DOUBLE(result, Z_DVAL_P(op1) * ((double)Z_LVAL_P(op2))); in mul_function()
1032 ZVAL_DOUBLE(result, Z_DVAL_P(op1) * Z_DVAL_P(op2)); in mul_function()
1038 } else if (Z_ISREF_P(op2)) { in mul_function()
1039 op2 = Z_REFVAL_P(op2); in mul_function()
1043 if (EXPECTED(op1 != op2)) { in mul_function()
1045 zendi_convert_scalar_to_number(op2, op2_copy, result, 0); in mul_function()
1048 op2 = op1; in mul_function()
1063 ZEND_API int ZEND_FASTCALL pow_function(zval *result, zval *op1, zval *op2) /* {{{ */ in pow_function() argument
1069 switch (TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2))) { in pow_function()
1071 if (Z_LVAL_P(op2) >= 0) { in pow_function()
1072 zend_long l1 = 1, l2 = Z_LVAL_P(op1), i = Z_LVAL_P(op2); in pow_function()
1105 ZVAL_DOUBLE(result, pow((double)Z_LVAL_P(op1), (double)Z_LVAL_P(op2))); in pow_function()
1110 ZVAL_DOUBLE(result, pow((double)Z_LVAL_P(op1), Z_DVAL_P(op2))); in pow_function()
1114 ZVAL_DOUBLE(result, pow(Z_DVAL_P(op1), (double)Z_LVAL_P(op2))); in pow_function()
1118 ZVAL_DOUBLE(result, pow(Z_DVAL_P(op1), Z_DVAL_P(op2))); in pow_function()
1124 } else if (Z_ISREF_P(op2)) { in pow_function()
1125 op2 = Z_REFVAL_P(op2); in pow_function()
1129 if (EXPECTED(op1 != op2)) { in pow_function()
1139 if (Z_TYPE_P(op2) == IS_ARRAY) { in pow_function()
1146 zendi_convert_scalar_to_number(op2, op2_copy, result, 0); in pow_function()
1158 op2 = op1; in pow_function()
1173 ZEND_API int ZEND_FASTCALL div_function(zval *result, zval *op1, zval *op2) /* {{{ */ in div_function() argument
1179 switch (TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2))) { in div_function()
1181 if (Z_LVAL_P(op2) == 0) { in div_function()
1183 ZVAL_DOUBLE(result, ((double) Z_LVAL_P(op1) / (double) Z_LVAL_P(op2))); in div_function()
1185 } else if (Z_LVAL_P(op2) == -1 && Z_LVAL_P(op1) == ZEND_LONG_MIN) { in div_function()
1190 if (Z_LVAL_P(op1) % Z_LVAL_P(op2) == 0) { /* integer */ in div_function()
1191 ZVAL_LONG(result, Z_LVAL_P(op1) / Z_LVAL_P(op2)); in div_function()
1193 ZVAL_DOUBLE(result, ((double) Z_LVAL_P(op1)) / Z_LVAL_P(op2)); in div_function()
1198 if (Z_LVAL_P(op2) == 0) { in div_function()
1201 ZVAL_DOUBLE(result, Z_DVAL_P(op1) / (double)Z_LVAL_P(op2)); in div_function()
1205 if (Z_DVAL_P(op2) == 0) { in div_function()
1208 ZVAL_DOUBLE(result, (double)Z_LVAL_P(op1) / Z_DVAL_P(op2)); in div_function()
1212 if (Z_DVAL_P(op2) == 0) { in div_function()
1215 ZVAL_DOUBLE(result, Z_DVAL_P(op1) / Z_DVAL_P(op2)); in div_function()
1221 } else if (Z_ISREF_P(op2)) { in div_function()
1222 op2 = Z_REFVAL_P(op2); in div_function()
1226 if (EXPECTED(op1 != op2)) { in div_function()
1228 zendi_convert_scalar_to_number(op2, op2_copy, result, 0); in div_function()
1231 op2 = op1; in div_function()
1246 ZEND_API int ZEND_FASTCALL mod_function(zval *result, zval *op1, zval *op2) /* {{{ */ in mod_function() argument
1250 convert_op1_op2_long(op1, op1_lval, op2, op2_lval, result, ZEND_MOD, mod_function); in mod_function()
1280 ZEND_API int ZEND_FASTCALL boolean_xor_function(zval *result, zval *op1, zval *op2) /* {{{ */ in boolean_xor_function() argument
1305 if (Z_TYPE_P(op2) == IS_FALSE) { in boolean_xor_function()
1307 } else if (EXPECTED(Z_TYPE_P(op2) == IS_TRUE)) { in boolean_xor_function()
1310 if (Z_ISREF_P(op2)) { in boolean_xor_function()
1311 op2 = Z_REFVAL_P(op2); in boolean_xor_function()
1312 if (Z_TYPE_P(op2) == IS_FALSE) { in boolean_xor_function()
1315 } else if (EXPECTED(Z_TYPE_P(op2) == IS_TRUE)) { in boolean_xor_function()
1321 op2_val = zval_is_true(op2); in boolean_xor_function()
1395 ZEND_API int ZEND_FASTCALL bitwise_or_function(zval *result, zval *op1, zval *op2) /* {{{ */ in bitwise_or_function() argument
1399 if (EXPECTED(Z_TYPE_P(op1) == IS_LONG) && EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { in bitwise_or_function()
1400 ZVAL_LONG(result, Z_LVAL_P(op1) | Z_LVAL_P(op2)); in bitwise_or_function()
1405 ZVAL_DEREF(op2); in bitwise_or_function()
1407 if (Z_TYPE_P(op1) == IS_STRING && EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { in bitwise_or_function()
1412 if (EXPECTED(Z_STRLEN_P(op1) >= Z_STRLEN_P(op2))) { in bitwise_or_function()
1413 if (EXPECTED(Z_STRLEN_P(op1) == Z_STRLEN_P(op2)) && Z_STRLEN_P(op1) == 1) { in bitwise_or_function()
1414 zend_uchar or = (zend_uchar) (*Z_STRVAL_P(op1) | *Z_STRVAL_P(op2)); in bitwise_or_function()
1422 shorter = op2; in bitwise_or_function()
1424 longer = op2; in bitwise_or_function()
1452 if (UNEXPECTED(Z_TYPE_P(op2) != IS_LONG)) { in bitwise_or_function()
1454 op2_lval = _zval_get_long_func_noisy(op2); in bitwise_or_function()
1462 op2_lval = Z_LVAL_P(op2); in bitwise_or_function()
1473 ZEND_API int ZEND_FASTCALL bitwise_and_function(zval *result, zval *op1, zval *op2) /* {{{ */ in bitwise_and_function() argument
1477 if (EXPECTED(Z_TYPE_P(op1) == IS_LONG) && EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { in bitwise_and_function()
1478 ZVAL_LONG(result, Z_LVAL_P(op1) & Z_LVAL_P(op2)); in bitwise_and_function()
1483 ZVAL_DEREF(op2); in bitwise_and_function()
1485 if (Z_TYPE_P(op1) == IS_STRING && Z_TYPE_P(op2) == IS_STRING) { in bitwise_and_function()
1490 if (EXPECTED(Z_STRLEN_P(op1) >= Z_STRLEN_P(op2))) { in bitwise_and_function()
1491 if (EXPECTED(Z_STRLEN_P(op1) == Z_STRLEN_P(op2)) && Z_STRLEN_P(op1) == 1) { in bitwise_and_function()
1492 zend_uchar and = (zend_uchar) (*Z_STRVAL_P(op1) & *Z_STRVAL_P(op2)); in bitwise_and_function()
1500 shorter = op2; in bitwise_and_function()
1502 longer = op2; in bitwise_and_function()
1530 if (UNEXPECTED(Z_TYPE_P(op2) != IS_LONG)) { in bitwise_and_function()
1532 op2_lval = _zval_get_long_func_noisy(op2); in bitwise_and_function()
1540 op2_lval = Z_LVAL_P(op2); in bitwise_and_function()
1551 ZEND_API int ZEND_FASTCALL bitwise_xor_function(zval *result, zval *op1, zval *op2) /* {{{ */ in bitwise_xor_function() argument
1555 if (EXPECTED(Z_TYPE_P(op1) == IS_LONG) && EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { in bitwise_xor_function()
1556 ZVAL_LONG(result, Z_LVAL_P(op1) ^ Z_LVAL_P(op2)); in bitwise_xor_function()
1561 ZVAL_DEREF(op2); in bitwise_xor_function()
1563 if (Z_TYPE_P(op1) == IS_STRING && Z_TYPE_P(op2) == IS_STRING) { in bitwise_xor_function()
1568 if (EXPECTED(Z_STRLEN_P(op1) >= Z_STRLEN_P(op2))) { in bitwise_xor_function()
1569 if (EXPECTED(Z_STRLEN_P(op1) == Z_STRLEN_P(op2)) && Z_STRLEN_P(op1) == 1) { in bitwise_xor_function()
1570 zend_uchar xor = (zend_uchar) (*Z_STRVAL_P(op1) ^ *Z_STRVAL_P(op2)); in bitwise_xor_function()
1578 shorter = op2; in bitwise_xor_function()
1580 longer = op2; in bitwise_xor_function()
1608 if (UNEXPECTED(Z_TYPE_P(op2) != IS_LONG)) { in bitwise_xor_function()
1610 op2_lval = _zval_get_long_func_noisy(op2); in bitwise_xor_function()
1618 op2_lval = Z_LVAL_P(op2); in bitwise_xor_function()
1629 ZEND_API int ZEND_FASTCALL shift_left_function(zval *result, zval *op1, zval *op2) /* {{{ */ in shift_left_function() argument
1633 convert_op1_op2_long(op1, op1_lval, op2, op2_lval, result, ZEND_SL, shift_left_function); in shift_left_function()
1665 ZEND_API int ZEND_FASTCALL shift_right_function(zval *result, zval *op1, zval *op2) /* {{{ */ in shift_right_function() argument
1669 convert_op1_op2_long(op1, op1_lval, op2, op2_lval, result, ZEND_SR, shift_right_function); in shift_right_function()
1701 ZEND_API int ZEND_FASTCALL concat_function(zval *result, zval *op1, zval *op2) /* {{{ */ in concat_function() argument
1724 if (UNEXPECTED(op1 == op2)) { in concat_function()
1725 op2 = &op1_copy; in concat_function()
1733 if (UNEXPECTED(Z_TYPE_P(op2) != IS_STRING)) { in concat_function()
1734 if (Z_ISREF_P(op2)) { in concat_function()
1735 op2 = Z_REFVAL_P(op2); in concat_function()
1736 if (Z_TYPE_P(op2) == IS_STRING) break; in concat_function()
1739 use_copy2 = zend_make_printable_zval(op2, &op2_copy); in concat_function()
1751 op2 = &op2_copy; in concat_function()
1758 size_t op2_len = Z_STRLEN_P(op2); in concat_function()
1768 zval_dtor(op2); in concat_function()
1792 memcpy(ZSTR_VAL(result_str) + op1_len, Z_STRVAL_P(op2), op2_len); in concat_function()
1800 zval_dtor(op2); in concat_function()
1806 ZEND_API int ZEND_FASTCALL string_compare_function_ex(zval *op1, zval *op2, zend_bool case_insensit… in string_compare_function_ex() argument
1809 zend_string *str2 = zval_get_string(op2); in string_compare_function_ex()
1824 ZEND_API int ZEND_FASTCALL string_compare_function(zval *op1, zval *op2) /* {{{ */ in string_compare_function() argument
1827 EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { in string_compare_function()
1828 if (Z_STR_P(op1) == Z_STR_P(op2)) { in string_compare_function()
1831 return zend_binary_strcmp(Z_STRVAL_P(op1), Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2)); in string_compare_function()
1835 zend_string *str2 = zval_get_string(op2); in string_compare_function()
1845 ZEND_API int ZEND_FASTCALL string_case_compare_function(zval *op1, zval *op2) /* {{{ */ in string_case_compare_function() argument
1848 EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { in string_case_compare_function()
1849 if (Z_STR_P(op1) == Z_STR_P(op2)) { in string_case_compare_function()
1852 …eturn zend_binary_strcasecmp_l(Z_STRVAL_P(op1), Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2)); in string_case_compare_function()
1856 zend_string *str2 = zval_get_string(op2); in string_case_compare_function()
1867 ZEND_API int ZEND_FASTCALL string_locale_compare_function(zval *op1, zval *op2) /* {{{ */ in string_locale_compare_function() argument
1870 zend_string *str2 = zval_get_string(op2); in string_locale_compare_function()
1880 ZEND_API int ZEND_FASTCALL numeric_compare_function(zval *op1, zval *op2) /* {{{ */ in numeric_compare_function() argument
1885 d2 = zval_get_double(op2); in numeric_compare_function()
1913 ZEND_API int ZEND_FASTCALL compare_function(zval *result, zval *op1, zval *op2) /* {{{ */ in compare_function() argument
1921 switch (TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2))) { in compare_function()
1923 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()
1927 Z_DVAL_P(result) = Z_DVAL_P(op1) - (double)Z_LVAL_P(op2); in compare_function()
1932 Z_DVAL_P(result) = (double)Z_LVAL_P(op1) - Z_DVAL_P(op2); in compare_function()
1937 if (Z_DVAL_P(op1) == Z_DVAL_P(op2)) { in compare_function()
1940 Z_DVAL_P(result) = Z_DVAL_P(op1) - Z_DVAL_P(op2); in compare_function()
1946 ZVAL_LONG(result, zend_compare_arrays(op1, op2)); in compare_function()
1966 if (Z_STR_P(op1) == Z_STR_P(op2)) { in compare_function()
1970 ZVAL_LONG(result, zendi_smart_strcmp(Z_STR_P(op1), Z_STR_P(op2))); in compare_function()
1974 ZVAL_LONG(result, Z_STRLEN_P(op2) == 0 ? 0 : -1); in compare_function()
1993 } else if (Z_ISREF_P(op2)) { in compare_function()
1994 op2 = Z_REFVAL_P(op2); in compare_function()
1999 ret = Z_OBJ_HANDLER_P(op1, compare)(result, op1, op2); in compare_function()
2004 } else if (Z_TYPE_P(op2) == IS_OBJECT && Z_OBJ_HANDLER_P(op2, compare)) { in compare_function()
2005 ret = Z_OBJ_HANDLER_P(op2, compare)(result, op1, op2); in compare_function()
2012 if (Z_TYPE_P(op1) == IS_OBJECT && Z_TYPE_P(op2) == IS_OBJECT) { in compare_function()
2013 if (Z_OBJ_P(op1) == Z_OBJ_P(op2)) { in compare_function()
2018 if (Z_OBJ_HANDLER_P(op1, compare_objects) == Z_OBJ_HANDLER_P(op2, compare_objects)) { in compare_function()
2019 ZVAL_LONG(result, Z_OBJ_HANDLER_P(op1, compare_objects)(op1, op2)); in compare_function()
2027 ret = compare_function(result, op_free, op2); in compare_function()
2030 } else if (Z_TYPE_P(op2) != IS_OBJECT && Z_OBJ_HT_P(op1)->cast_object) { in compare_function()
2032 …->cast_object(op1, &tmp_free, ((Z_TYPE_P(op2) == IS_FALSE || Z_TYPE_P(op2) == IS_TRUE) ? _IS_BOOL … in compare_function()
2037 ret = compare_function(result, &tmp_free, op2); in compare_function()
2042 if (Z_TYPE_P(op2) == IS_OBJECT) { in compare_function()
2043 if (Z_OBJ_HT_P(op2)->get) { in compare_function()
2045 op_free = Z_OBJ_HT_P(op2)->get(op2, &rv); in compare_function()
2049 } else if (Z_TYPE_P(op1) != IS_OBJECT && Z_OBJ_HT_P(op2)->cast_object) { in compare_function()
2051 …if (Z_OBJ_HT_P(op2)->cast_object(op2, &tmp_free, ((Z_TYPE_P(op1) == IS_FALSE || Z_TYPE_P(op1) == I… in compare_function()
2066 ZVAL_LONG(result, zval_is_true(op2) ? -1 : 0); in compare_function()
2068 } else if (Z_TYPE_P(op2) == IS_NULL || Z_TYPE_P(op2) == IS_FALSE) { in compare_function()
2072 ZVAL_LONG(result, zval_is_true(op2) ? 0 : 1); in compare_function()
2074 } else if (Z_TYPE_P(op2) == IS_TRUE) { in compare_function()
2079 zendi_convert_scalar_to_number(op2, op2_copy, result, 1); in compare_function()
2085 } else if (Z_TYPE_P(op2)==IS_ARRAY) { in compare_function()
2091 } else if (Z_TYPE_P(op2)==IS_OBJECT) { in compare_function()
2121 ZEND_API int ZEND_FASTCALL zend_is_identical(zval *op1, zval *op2) /* {{{ */ in zend_is_identical() argument
2123 if (Z_TYPE_P(op1) != Z_TYPE_P(op2)) { in zend_is_identical()
2132 return (Z_LVAL_P(op1) == Z_LVAL_P(op2)); in zend_is_identical()
2134 return (Z_RES_P(op1) == Z_RES_P(op2)); in zend_is_identical()
2136 return (Z_DVAL_P(op1) == Z_DVAL_P(op2)); in zend_is_identical()
2138 return (Z_STR_P(op1) == Z_STR_P(op2) || in zend_is_identical()
2139 (Z_STRLEN_P(op1) == Z_STRLEN_P(op2) && in zend_is_identical()
2140 memcmp(Z_STRVAL_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op1)) == 0)); in zend_is_identical()
2142 return (Z_ARRVAL_P(op1) == Z_ARRVAL_P(op2) || in zend_is_identical()
2143 …zend_hash_compare(Z_ARRVAL_P(op1), Z_ARRVAL_P(op2), (compare_func_t) hash_zval_identical_function,… in zend_is_identical()
2145 return (Z_OBJ_P(op1) == Z_OBJ_P(op2) && Z_OBJ_HT_P(op1) == Z_OBJ_HT_P(op2)); in zend_is_identical()
2152 ZEND_API int ZEND_FASTCALL is_identical_function(zval *result, zval *op1, zval *op2) /* {{{ */ in is_identical_function() argument
2154 ZVAL_BOOL(result, zend_is_identical(op1, op2)); in is_identical_function()
2159 ZEND_API int ZEND_FASTCALL is_not_identical_function(zval *result, zval *op1, zval *op2) /* {{{ */ in is_not_identical_function() argument
2161 ZVAL_BOOL(result, !zend_is_identical(op1, op2)); in is_not_identical_function()
2166 ZEND_API int ZEND_FASTCALL is_equal_function(zval *result, zval *op1, zval *op2) /* {{{ */ in is_equal_function() argument
2168 if (compare_function(result, op1, op2) == FAILURE) { in is_equal_function()
2176 ZEND_API int ZEND_FASTCALL is_not_equal_function(zval *result, zval *op1, zval *op2) /* {{{ */ in is_not_equal_function() argument
2178 if (compare_function(result, op1, op2) == FAILURE) { in is_not_equal_function()
2186 ZEND_API int ZEND_FASTCALL is_smaller_function(zval *result, zval *op1, zval *op2) /* {{{ */ in is_smaller_function() argument
2188 if (compare_function(result, op1, op2) == FAILURE) { in is_smaller_function()
2196 ZEND_API int ZEND_FASTCALL is_smaller_or_equal_function(zval *result, zval *op1, zval *op2) /* {{{ … in is_smaller_or_equal_function() argument
2198 if (compare_function(result, op1, op2) == FAILURE) { in is_smaller_or_equal_function()
2413 zval op2; in increment_function() local
2416 ZVAL_LONG(&op2, 1); in increment_function()
2417 res = Z_OBJ_HANDLER_P(op1, do_operation)(ZEND_ADD, op1, op1, &op2); in increment_function()
2418 zval_ptr_dtor(&op2); in increment_function()
2481 zval op2; in decrement_function() local
2484 ZVAL_LONG(&op2, 1); in decrement_function()
2485 res = Z_OBJ_HANDLER_P(op1, do_operation)(ZEND_SUB, op1, op1, &op2); in decrement_function()
2486 zval_ptr_dtor(&op2); in decrement_function()