Lines Matching refs:op2

257 #define convert_op1_op2_long(op1, op1_lval, op2, op2_lval, op, op_func) \  argument
277 if (UNEXPECTED(Z_TYPE_P(op2) != IS_LONG)) { \
278 if (Z_ISREF_P(op2)) { \
279 op2 = Z_REFVAL_P(op2); \
280 if (Z_TYPE_P(op2) == IS_LONG) { \
281 op2_lval = Z_LVAL_P(op2); \
286 op2_lval = _zval_get_long_func_noisy(op2); \
291 op2_lval = Z_LVAL_P(op2); \
915 ZEND_API int ZEND_FASTCALL add_function(zval *result, zval *op1, zval *op2) /* {{{ */ in add_function() argument
921 switch (TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2))) { in add_function()
923 fast_long_add_function(result, op1, op2); in add_function()
926 ZVAL_DOUBLE(result, ((double)Z_LVAL_P(op1)) + Z_DVAL_P(op2)); in add_function()
930 ZVAL_DOUBLE(result, Z_DVAL_P(op1) + ((double)Z_LVAL_P(op2))); in add_function()
934 ZVAL_DOUBLE(result, Z_DVAL_P(op1) + Z_DVAL_P(op2)); in add_function()
938 if ((result == op1) && (result == op2)) { in add_function()
945 zend_hash_merge(Z_ARRVAL_P(result), Z_ARRVAL_P(op2), zval_add_ref, 0); in add_function()
951 } else if (Z_ISREF_P(op2)) { in add_function()
952 op2 = Z_REFVAL_P(op2); in add_function()
956 if (EXPECTED(op1 != op2)) { in add_function()
958 zendi_convert_scalar_to_number(op2, op2_copy, result, 0); in add_function()
961 op2 = op1; in add_function()
973 ZEND_API int ZEND_FASTCALL sub_function(zval *result, zval *op1, zval *op2) /* {{{ */ in sub_function() argument
979 switch (TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2))) { in sub_function()
981 fast_long_sub_function(result, op1, op2); in sub_function()
984 ZVAL_DOUBLE(result, ((double)Z_LVAL_P(op1)) - Z_DVAL_P(op2)); in sub_function()
988 ZVAL_DOUBLE(result, Z_DVAL_P(op1) - ((double)Z_LVAL_P(op2))); in sub_function()
992 ZVAL_DOUBLE(result, Z_DVAL_P(op1) - Z_DVAL_P(op2)); in sub_function()
998 } else if (Z_ISREF_P(op2)) { in sub_function()
999 op2 = Z_REFVAL_P(op2); in sub_function()
1003 if (EXPECTED(op1 != op2)) { in sub_function()
1005 zendi_convert_scalar_to_number(op2, op2_copy, result, 0); in sub_function()
1008 op2 = op1; in sub_function()
1020 ZEND_API int ZEND_FASTCALL mul_function(zval *result, zval *op1, zval *op2) /* {{{ */ in mul_function() argument
1026 switch (TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2))) { in mul_function()
1030 …ZEND_SIGNED_MULTIPLY_LONG(Z_LVAL_P(op1),Z_LVAL_P(op2), Z_LVAL_P(result),Z_DVAL_P(result),overflow); in mul_function()
1036 ZVAL_DOUBLE(result, ((double)Z_LVAL_P(op1)) * Z_DVAL_P(op2)); in mul_function()
1040 ZVAL_DOUBLE(result, Z_DVAL_P(op1) * ((double)Z_LVAL_P(op2))); in mul_function()
1044 ZVAL_DOUBLE(result, Z_DVAL_P(op1) * Z_DVAL_P(op2)); in mul_function()
1050 } else if (Z_ISREF_P(op2)) { in mul_function()
1051 op2 = Z_REFVAL_P(op2); in mul_function()
1055 if (EXPECTED(op1 != op2)) { in mul_function()
1057 zendi_convert_scalar_to_number(op2, op2_copy, result, 0); in mul_function()
1060 op2 = op1; in mul_function()
1072 ZEND_API int ZEND_FASTCALL pow_function(zval *result, zval *op1, zval *op2) /* {{{ */ in pow_function() argument
1078 switch (TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2))) { in pow_function()
1080 if (Z_LVAL_P(op2) >= 0) { in pow_function()
1081 zend_long l1 = 1, l2 = Z_LVAL_P(op1), i = Z_LVAL_P(op2); in pow_function()
1114 ZVAL_DOUBLE(result, pow((double)Z_LVAL_P(op1), (double)Z_LVAL_P(op2))); in pow_function()
1119 ZVAL_DOUBLE(result, pow((double)Z_LVAL_P(op1), Z_DVAL_P(op2))); in pow_function()
1123 ZVAL_DOUBLE(result, pow(Z_DVAL_P(op1), (double)Z_LVAL_P(op2))); in pow_function()
1127 ZVAL_DOUBLE(result, pow(Z_DVAL_P(op1), Z_DVAL_P(op2))); in pow_function()
1133 } else if (Z_ISREF_P(op2)) { in pow_function()
1134 op2 = Z_REFVAL_P(op2); in pow_function()
1138 if (EXPECTED(op1 != op2)) { in pow_function()
1145 if (Z_TYPE_P(op2) == IS_ARRAY) { in pow_function()
1149 zendi_convert_scalar_to_number(op2, op2_copy, result, 0); in pow_function()
1158 op2 = op1; in pow_function()
1170 ZEND_API int ZEND_FASTCALL div_function(zval *result, zval *op1, zval *op2) /* {{{ */ in div_function() argument
1176 switch (TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2))) { in div_function()
1178 if (Z_LVAL_P(op2) == 0) { in div_function()
1180 ZVAL_DOUBLE(result, ((double) Z_LVAL_P(op1) / (double) Z_LVAL_P(op2))); in div_function()
1182 } else if (Z_LVAL_P(op2) == -1 && Z_LVAL_P(op1) == ZEND_LONG_MIN) { in div_function()
1187 if (Z_LVAL_P(op1) % Z_LVAL_P(op2) == 0) { /* integer */ in div_function()
1188 ZVAL_LONG(result, Z_LVAL_P(op1) / Z_LVAL_P(op2)); in div_function()
1190 ZVAL_DOUBLE(result, ((double) Z_LVAL_P(op1)) / Z_LVAL_P(op2)); in div_function()
1195 if (Z_LVAL_P(op2) == 0) { in div_function()
1198 ZVAL_DOUBLE(result, Z_DVAL_P(op1) / (double)Z_LVAL_P(op2)); in div_function()
1202 if (Z_DVAL_P(op2) == 0) { in div_function()
1205 ZVAL_DOUBLE(result, (double)Z_LVAL_P(op1) / Z_DVAL_P(op2)); in div_function()
1209 if (Z_DVAL_P(op2) == 0) { in div_function()
1212 ZVAL_DOUBLE(result, Z_DVAL_P(op1) / Z_DVAL_P(op2)); in div_function()
1218 } else if (Z_ISREF_P(op2)) { in div_function()
1219 op2 = Z_REFVAL_P(op2); in div_function()
1223 if (EXPECTED(op1 != op2)) { in div_function()
1225 zendi_convert_scalar_to_number(op2, op2_copy, result, 0); in div_function()
1228 op2 = op1; in div_function()
1240 ZEND_API int ZEND_FASTCALL mod_function(zval *result, zval *op1, zval *op2) /* {{{ */ in mod_function() argument
1244 convert_op1_op2_long(op1, op1_lval, op2, op2_lval, ZEND_MOD, mod_function); in mod_function()
1274 ZEND_API int ZEND_FASTCALL boolean_xor_function(zval *result, zval *op1, zval *op2) /* {{{ */ in boolean_xor_function() argument
1299 if (Z_TYPE_P(op2) == IS_FALSE) { in boolean_xor_function()
1301 } else if (EXPECTED(Z_TYPE_P(op2) == IS_TRUE)) { in boolean_xor_function()
1304 if (Z_ISREF_P(op2)) { in boolean_xor_function()
1305 op2 = Z_REFVAL_P(op2); in boolean_xor_function()
1306 if (Z_TYPE_P(op2) == IS_FALSE) { in boolean_xor_function()
1309 } else if (EXPECTED(Z_TYPE_P(op2) == IS_TRUE)) { in boolean_xor_function()
1315 op2_val = zval_is_true(op2); in boolean_xor_function()
1390 ZEND_API int ZEND_FASTCALL bitwise_or_function(zval *result, zval *op1, zval *op2) /* {{{ */ in bitwise_or_function() argument
1394 if (EXPECTED(Z_TYPE_P(op1) == IS_LONG) && EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { in bitwise_or_function()
1395 ZVAL_LONG(result, Z_LVAL_P(op1) | Z_LVAL_P(op2)); in bitwise_or_function()
1400 ZVAL_DEREF(op2); in bitwise_or_function()
1402 if (Z_TYPE_P(op1) == IS_STRING && EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { in bitwise_or_function()
1407 if (EXPECTED(Z_STRLEN_P(op1) >= Z_STRLEN_P(op2))) { in bitwise_or_function()
1408 if (EXPECTED(Z_STRLEN_P(op1) == Z_STRLEN_P(op2)) && Z_STRLEN_P(op1) == 1) { in bitwise_or_function()
1409 zend_uchar or = (zend_uchar) (*Z_STRVAL_P(op1) | *Z_STRVAL_P(op2)); in bitwise_or_function()
1421 shorter = op2; in bitwise_or_function()
1423 longer = op2; in bitwise_or_function()
1448 if (UNEXPECTED(Z_TYPE_P(op2) != IS_LONG)) { in bitwise_or_function()
1450 op2_lval = _zval_get_long_func_noisy(op2); in bitwise_or_function()
1455 op2_lval = Z_LVAL_P(op2); in bitwise_or_function()
1466 ZEND_API int ZEND_FASTCALL bitwise_and_function(zval *result, zval *op1, zval *op2) /* {{{ */ in bitwise_and_function() argument
1470 if (EXPECTED(Z_TYPE_P(op1) == IS_LONG) && EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { in bitwise_and_function()
1471 ZVAL_LONG(result, Z_LVAL_P(op1) & Z_LVAL_P(op2)); in bitwise_and_function()
1476 ZVAL_DEREF(op2); in bitwise_and_function()
1478 if (Z_TYPE_P(op1) == IS_STRING && Z_TYPE_P(op2) == IS_STRING) { in bitwise_and_function()
1483 if (EXPECTED(Z_STRLEN_P(op1) >= Z_STRLEN_P(op2))) { in bitwise_and_function()
1484 if (EXPECTED(Z_STRLEN_P(op1) == Z_STRLEN_P(op2)) && Z_STRLEN_P(op1) == 1) { in bitwise_and_function()
1485 zend_uchar and = (zend_uchar) (*Z_STRVAL_P(op1) & *Z_STRVAL_P(op2)); in bitwise_and_function()
1497 shorter = op2; in bitwise_and_function()
1499 longer = op2; in bitwise_and_function()
1524 if (UNEXPECTED(Z_TYPE_P(op2) != IS_LONG)) { in bitwise_and_function()
1526 op2_lval = _zval_get_long_func_noisy(op2); in bitwise_and_function()
1531 op2_lval = Z_LVAL_P(op2); in bitwise_and_function()
1542 ZEND_API int ZEND_FASTCALL bitwise_xor_function(zval *result, zval *op1, zval *op2) /* {{{ */ in bitwise_xor_function() argument
1546 if (EXPECTED(Z_TYPE_P(op1) == IS_LONG) && EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { in bitwise_xor_function()
1547 ZVAL_LONG(result, Z_LVAL_P(op1) ^ Z_LVAL_P(op2)); in bitwise_xor_function()
1552 ZVAL_DEREF(op2); in bitwise_xor_function()
1554 if (Z_TYPE_P(op1) == IS_STRING && Z_TYPE_P(op2) == IS_STRING) { in bitwise_xor_function()
1559 if (EXPECTED(Z_STRLEN_P(op1) >= Z_STRLEN_P(op2))) { in bitwise_xor_function()
1560 if (EXPECTED(Z_STRLEN_P(op1) == Z_STRLEN_P(op2)) && Z_STRLEN_P(op1) == 1) { in bitwise_xor_function()
1561 zend_uchar xor = (zend_uchar) (*Z_STRVAL_P(op1) ^ *Z_STRVAL_P(op2)); in bitwise_xor_function()
1573 shorter = op2; in bitwise_xor_function()
1575 longer = op2; in bitwise_xor_function()
1600 if (UNEXPECTED(Z_TYPE_P(op2) != IS_LONG)) { in bitwise_xor_function()
1602 op2_lval = _zval_get_long_func_noisy(op2); in bitwise_xor_function()
1607 op2_lval = Z_LVAL_P(op2); in bitwise_xor_function()
1618 ZEND_API int ZEND_FASTCALL shift_left_function(zval *result, zval *op1, zval *op2) /* {{{ */ in shift_left_function() argument
1622 convert_op1_op2_long(op1, op1_lval, op2, op2_lval, ZEND_SL, shift_left_function); in shift_left_function()
1654 ZEND_API int ZEND_FASTCALL shift_right_function(zval *result, zval *op1, zval *op2) /* {{{ */ in shift_right_function() argument
1658 convert_op1_op2_long(op1, op1_lval, op2, op2_lval, ZEND_SR, shift_right_function); in shift_right_function()
1690 ZEND_API int ZEND_FASTCALL concat_function(zval *result, zval *op1, zval *op2) /* {{{ */ in concat_function() argument
1710 if (UNEXPECTED(op1 == op2)) { in concat_function()
1711 op2 = &op1_copy; in concat_function()
1719 if (UNEXPECTED(Z_TYPE_P(op2) != IS_STRING)) { in concat_function()
1720 if (Z_ISREF_P(op2)) { in concat_function()
1721 op2 = Z_REFVAL_P(op2); in concat_function()
1722 if (Z_TYPE_P(op2) == IS_STRING) break; in concat_function()
1725 use_copy2 = zend_make_printable_zval(op2, &op2_copy); in concat_function()
1734 op2 = &op2_copy; in concat_function()
1741 size_t op2_len = Z_STRLEN_P(op2); in concat_function()
1751 zval_dtor(op2); in concat_function()
1775 memcpy(ZSTR_VAL(result_str) + op1_len, Z_STRVAL_P(op2), op2_len); in concat_function()
1783 zval_dtor(op2); in concat_function()
1789 ZEND_API int ZEND_FASTCALL string_compare_function_ex(zval *op1, zval *op2, zend_bool case_insensit… in string_compare_function_ex() argument
1792 zend_string *str2 = zval_get_string(op2); in string_compare_function_ex()
1807 ZEND_API int ZEND_FASTCALL string_compare_function(zval *op1, zval *op2) /* {{{ */ in string_compare_function() argument
1810 EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { in string_compare_function()
1811 if (Z_STR_P(op1) == Z_STR_P(op2)) { in string_compare_function()
1814 return zend_binary_strcmp(Z_STRVAL_P(op1), Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2)); in string_compare_function()
1818 zend_string *str2 = zval_get_string(op2); in string_compare_function()
1828 ZEND_API int ZEND_FASTCALL string_case_compare_function(zval *op1, zval *op2) /* {{{ */ in string_case_compare_function() argument
1831 EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { in string_case_compare_function()
1832 if (Z_STR_P(op1) == Z_STR_P(op2)) { in string_case_compare_function()
1835 …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()
1839 zend_string *str2 = zval_get_string(op2); in string_case_compare_function()
1850 ZEND_API int ZEND_FASTCALL string_locale_compare_function(zval *op1, zval *op2) /* {{{ */ in string_locale_compare_function() argument
1853 zend_string *str2 = zval_get_string(op2); in string_locale_compare_function()
1863 ZEND_API int ZEND_FASTCALL numeric_compare_function(zval *op1, zval *op2) /* {{{ */ in numeric_compare_function() argument
1868 d2 = zval_get_double(op2); in numeric_compare_function()
1896 ZEND_API int ZEND_FASTCALL compare_function(zval *result, zval *op1, zval *op2) /* {{{ */ in compare_function() argument
1904 switch (TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2))) { in compare_function()
1906 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()
1910 Z_DVAL_P(result) = Z_DVAL_P(op1) - (double)Z_LVAL_P(op2); in compare_function()
1915 Z_DVAL_P(result) = (double)Z_LVAL_P(op1) - Z_DVAL_P(op2); in compare_function()
1920 if (Z_DVAL_P(op1) == Z_DVAL_P(op2)) { in compare_function()
1923 Z_DVAL_P(result) = Z_DVAL_P(op1) - Z_DVAL_P(op2); in compare_function()
1929 ZVAL_LONG(result, zend_compare_arrays(op1, op2)); in compare_function()
1949 if (Z_STR_P(op1) == Z_STR_P(op2)) { in compare_function()
1953 ZVAL_LONG(result, zendi_smart_strcmp(Z_STR_P(op1), Z_STR_P(op2))); in compare_function()
1957 ZVAL_LONG(result, Z_STRLEN_P(op2) == 0 ? 0 : -1); in compare_function()
1976 } else if (Z_ISREF_P(op2)) { in compare_function()
1977 op2 = Z_REFVAL_P(op2); in compare_function()
1982 ret = Z_OBJ_HANDLER_P(op1, compare)(result, op1, op2); in compare_function()
1987 } else if (Z_TYPE_P(op2) == IS_OBJECT && Z_OBJ_HANDLER_P(op2, compare)) { in compare_function()
1988 ret = Z_OBJ_HANDLER_P(op2, compare)(result, op1, op2); in compare_function()
1995 if (Z_TYPE_P(op1) == IS_OBJECT && Z_TYPE_P(op2) == IS_OBJECT) { in compare_function()
1996 if (Z_OBJ_P(op1) == Z_OBJ_P(op2)) { in compare_function()
2001 if (Z_OBJ_HANDLER_P(op1, compare_objects) == Z_OBJ_HANDLER_P(op2, compare_objects)) { in compare_function()
2002 ZVAL_LONG(result, Z_OBJ_HANDLER_P(op1, compare_objects)(op1, op2)); in compare_function()
2010 ret = compare_function(result, op_free, op2); in compare_function()
2013 } else if (Z_TYPE_P(op2) != IS_OBJECT && Z_OBJ_HT_P(op1)->cast_object) { in compare_function()
2015 …->cast_object(op1, &tmp_free, ((Z_TYPE_P(op2) == IS_FALSE || Z_TYPE_P(op2) == IS_TRUE) ? _IS_BOOL … in compare_function()
2020 ret = compare_function(result, &tmp_free, op2); in compare_function()
2025 if (Z_TYPE_P(op2) == IS_OBJECT) { in compare_function()
2026 if (Z_OBJ_HT_P(op2)->get) { in compare_function()
2028 op_free = Z_OBJ_HT_P(op2)->get(op2, &rv); in compare_function()
2032 } else if (Z_TYPE_P(op1) != IS_OBJECT && Z_OBJ_HT_P(op2)->cast_object) { in compare_function()
2034 …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()
2049 ZVAL_LONG(result, zval_is_true(op2) ? -1 : 0); in compare_function()
2051 } else if (Z_TYPE_P(op2) == IS_NULL || Z_TYPE_P(op2) == IS_FALSE) { in compare_function()
2055 ZVAL_LONG(result, zval_is_true(op2) ? 0 : 1); in compare_function()
2057 } else if (Z_TYPE_P(op2) == IS_TRUE) { in compare_function()
2062 zendi_convert_scalar_to_number(op2, op2_copy, result, 1); in compare_function()
2068 } else if (Z_TYPE_P(op2)==IS_ARRAY) { in compare_function()
2074 } else if (Z_TYPE_P(op2)==IS_OBJECT) { in compare_function()
2104 ZEND_API int ZEND_FASTCALL zend_is_identical(zval *op1, zval *op2) /* {{{ */ in zend_is_identical() argument
2106 if (Z_TYPE_P(op1) != Z_TYPE_P(op2)) { in zend_is_identical()
2115 return (Z_LVAL_P(op1) == Z_LVAL_P(op2)); in zend_is_identical()
2117 return (Z_RES_P(op1) == Z_RES_P(op2)); in zend_is_identical()
2119 return (Z_DVAL_P(op1) == Z_DVAL_P(op2)); in zend_is_identical()
2121 return (Z_STR_P(op1) == Z_STR_P(op2) || in zend_is_identical()
2122 (Z_STRLEN_P(op1) == Z_STRLEN_P(op2) && in zend_is_identical()
2123 memcmp(Z_STRVAL_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op1)) == 0)); in zend_is_identical()
2125 return (Z_ARRVAL_P(op1) == Z_ARRVAL_P(op2) || in zend_is_identical()
2126 …zend_hash_compare(Z_ARRVAL_P(op1), Z_ARRVAL_P(op2), (compare_func_t) hash_zval_identical_function,… in zend_is_identical()
2128 return (Z_OBJ_P(op1) == Z_OBJ_P(op2) && Z_OBJ_HT_P(op1) == Z_OBJ_HT_P(op2)); in zend_is_identical()
2135 ZEND_API int ZEND_FASTCALL is_identical_function(zval *result, zval *op1, zval *op2) /* {{{ */ in is_identical_function() argument
2137 ZVAL_BOOL(result, zend_is_identical(op1, op2)); in is_identical_function()
2142 ZEND_API int ZEND_FASTCALL is_not_identical_function(zval *result, zval *op1, zval *op2) /* {{{ */ in is_not_identical_function() argument
2144 ZVAL_BOOL(result, !zend_is_identical(op1, op2)); in is_not_identical_function()
2149 ZEND_API int ZEND_FASTCALL is_equal_function(zval *result, zval *op1, zval *op2) /* {{{ */ in is_equal_function() argument
2151 if (compare_function(result, op1, op2) == FAILURE) { in is_equal_function()
2159 ZEND_API int ZEND_FASTCALL is_not_equal_function(zval *result, zval *op1, zval *op2) /* {{{ */ in is_not_equal_function() argument
2161 if (compare_function(result, op1, op2) == FAILURE) { in is_not_equal_function()
2169 ZEND_API int ZEND_FASTCALL is_smaller_function(zval *result, zval *op1, zval *op2) /* {{{ */ in is_smaller_function() argument
2171 if (compare_function(result, op1, op2) == FAILURE) { in is_smaller_function()
2179 ZEND_API int ZEND_FASTCALL is_smaller_or_equal_function(zval *result, zval *op1, zval *op2) /* {{{ … in is_smaller_or_equal_function() argument
2181 if (compare_function(result, op1, op2) == FAILURE) { in is_smaller_or_equal_function()
2401 zval op2; in increment_function() local
2404 ZVAL_LONG(&op2, 1); in increment_function()
2405 res = Z_OBJ_HANDLER_P(op1, do_operation)(ZEND_ADD, op1, op1, &op2); in increment_function()
2406 zval_ptr_dtor(&op2); in increment_function()
2469 zval op2; in decrement_function() local
2472 ZVAL_LONG(&op2, 1); in decrement_function()
2473 res = Z_OBJ_HANDLER_P(op1, do_operation)(ZEND_SUB, op1, op1, &op2); in decrement_function()
2474 zval_ptr_dtor(&op2); in decrement_function()