Lines Matching refs:op1

357 	if (UNEXPECTED(Z_TYPE_P(op1) == IS_OBJECT) \
358 && UNEXPECTED(Z_OBJ_HANDLER_P(op1, do_operation))) { \
359 if (EXPECTED(SUCCESS == Z_OBJ_HANDLER_P(op1, do_operation)(opcode, result, op1, op2))) { \
367 && EXPECTED(SUCCESS == Z_OBJ_HANDLER_P(op2, do_operation)(opcode, result, op1, op2))) { \
377 if (UNEXPECTED(Z_TYPE_P(op1) == IS_OBJECT) \
378 && UNEXPECTED(Z_OBJ_HANDLER_P(op1, do_operation)) \
379 && EXPECTED(SUCCESS == Z_OBJ_HANDLER_P(op1, do_operation)(opcode, result, op1, NULL))) { \
383 #define convert_op1_op2_long(op1, op1_lval, op2, op2_lval, result, opcode, sigil) \ argument
385 if (UNEXPECTED(Z_TYPE_P(op1) != IS_LONG)) { \
387 if (Z_ISREF_P(op1)) { \
388 op1 = Z_REFVAL_P(op1); \
389 if (Z_TYPE_P(op1) == IS_LONG) { \
390 op1_lval = Z_LVAL_P(op1); \
395 op1_lval = zendi_try_get_long(op1, &failed); \
397 zend_binop_error(sigil, op1, op2); \
398 if (result != op1) { \
404 op1_lval = Z_LVAL_P(op1); \
420 zend_binop_error(sigil, op1, op2); \
421 if (result != op1) { \
956 …ver_inline void ZEND_FASTCALL zend_binop_error(const char *operator, zval *op1, zval *op2) /* {{{ … in zend_binop_error() argument
962 zend_zval_type_name(op1), operator, zend_zval_type_name(op2)); in zend_binop_error()
966 static zend_never_inline void ZEND_FASTCALL add_function_array(zval *result, zval *op1, zval *op2) … in add_function_array() argument
968 if (result == op1 && Z_ARR_P(op1) == Z_ARR_P(op2)) { in add_function_array()
972 if (result != op1) { in add_function_array()
973 ZVAL_ARR(result, zend_array_dup(Z_ARR_P(op1))); in add_function_array()
981 static zend_always_inline zend_result add_function_fast(zval *result, zval *op1, zval *op2) /* {{{ … in add_function_fast() argument
983 zend_uchar type_pair = TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2)); in add_function_fast()
986 fast_long_add_function(result, op1, op2); in add_function_fast()
989 ZVAL_DOUBLE(result, Z_DVAL_P(op1) + Z_DVAL_P(op2)); in add_function_fast()
992 ZVAL_DOUBLE(result, ((double)Z_LVAL_P(op1)) + Z_DVAL_P(op2)); in add_function_fast()
995 ZVAL_DOUBLE(result, Z_DVAL_P(op1) + ((double)Z_LVAL_P(op2))); in add_function_fast()
998 add_function_array(result, op1, op2); in add_function_fast()
1005 static zend_never_inline zend_result ZEND_FASTCALL add_function_slow(zval *result, zval *op1, zval … in add_function_slow() argument
1007 ZVAL_DEREF(op1); in add_function_slow()
1009 if (add_function_fast(result, op1, op2) == SUCCESS) { in add_function_slow()
1016 if (UNEXPECTED(zendi_try_convert_scalar_to_number(op1, &op1_copy) == FAILURE) in add_function_slow()
1018 zend_binop_error("+", op1, op2); in add_function_slow()
1019 if (result != op1) { in add_function_slow()
1025 if (result == op1) { in add_function_slow()
1037 ZEND_API zend_result ZEND_FASTCALL add_function(zval *result, zval *op1, zval *op2) /* {{{ */ in add_function() argument
1039 if (add_function_fast(result, op1, op2) == SUCCESS) { in add_function()
1042 return add_function_slow(result, op1, op2); in add_function()
1047 static zend_always_inline zend_result sub_function_fast(zval *result, zval *op1, zval *op2) /* {{{ … in sub_function_fast() argument
1049 zend_uchar type_pair = TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2)); in sub_function_fast()
1052 fast_long_sub_function(result, op1, op2); in sub_function_fast()
1055 ZVAL_DOUBLE(result, Z_DVAL_P(op1) - Z_DVAL_P(op2)); in sub_function_fast()
1058 ZVAL_DOUBLE(result, ((double)Z_LVAL_P(op1)) - Z_DVAL_P(op2)); in sub_function_fast()
1061 ZVAL_DOUBLE(result, Z_DVAL_P(op1) - ((double)Z_LVAL_P(op2))); in sub_function_fast()
1069 static zend_never_inline zend_result ZEND_FASTCALL sub_function_slow(zval *result, zval *op1, zval … in sub_function_slow() argument
1071 ZVAL_DEREF(op1); in sub_function_slow()
1073 if (sub_function_fast(result, op1, op2) == SUCCESS) { in sub_function_slow()
1080 if (UNEXPECTED(zendi_try_convert_scalar_to_number(op1, &op1_copy) == FAILURE) in sub_function_slow()
1082 zend_binop_error("-", op1, op2); in sub_function_slow()
1083 if (result != op1) { in sub_function_slow()
1089 if (result == op1) { in sub_function_slow()
1102 ZEND_API zend_result ZEND_FASTCALL sub_function(zval *result, zval *op1, zval *op2) /* {{{ */ in sub_function() argument
1104 if (sub_function_fast(result, op1, op2) == SUCCESS) { in sub_function()
1107 return sub_function_slow(result, op1, op2); in sub_function()
1112 static zend_always_inline zend_result mul_function_fast(zval *result, zval *op1, zval *op2) /* {{{ … in mul_function_fast() argument
1114 zend_uchar type_pair = TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2)); in mul_function_fast()
1119 Z_LVAL_P(op1), Z_LVAL_P(op2), in mul_function_fast()
1124 ZVAL_DOUBLE(result, Z_DVAL_P(op1) * Z_DVAL_P(op2)); in mul_function_fast()
1127 ZVAL_DOUBLE(result, ((double)Z_LVAL_P(op1)) * Z_DVAL_P(op2)); in mul_function_fast()
1130 ZVAL_DOUBLE(result, Z_DVAL_P(op1) * ((double)Z_LVAL_P(op2))); in mul_function_fast()
1138 static zend_never_inline zend_result ZEND_FASTCALL mul_function_slow(zval *result, zval *op1, zval … in mul_function_slow() argument
1140 ZVAL_DEREF(op1); in mul_function_slow()
1142 if (mul_function_fast(result, op1, op2) == SUCCESS) { in mul_function_slow()
1149 if (UNEXPECTED(zendi_try_convert_scalar_to_number(op1, &op1_copy) == FAILURE) in mul_function_slow()
1151 zend_binop_error("*", op1, op2); in mul_function_slow()
1152 if (result != op1) { in mul_function_slow()
1158 if (result == op1) { in mul_function_slow()
1171 ZEND_API zend_result ZEND_FASTCALL mul_function(zval *result, zval *op1, zval *op2) /* {{{ */ in mul_function() argument
1173 if (mul_function_fast(result, op1, op2) == SUCCESS) { in mul_function()
1176 return mul_function_slow(result, op1, op2); in mul_function()
1181 static zend_result ZEND_FASTCALL pow_function_base(zval *result, zval *op1, zval *op2) /* {{{ */ in pow_function_base() argument
1183 zend_uchar type_pair = TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2)); in pow_function_base()
1187 zend_long l1 = 1, l2 = Z_LVAL_P(op1), i = Z_LVAL_P(op2); in pow_function_base()
1220 ZVAL_DOUBLE(result, pow((double)Z_LVAL_P(op1), (double)Z_LVAL_P(op2))); in pow_function_base()
1224 ZVAL_DOUBLE(result, pow(Z_DVAL_P(op1), Z_DVAL_P(op2))); in pow_function_base()
1227 ZVAL_DOUBLE(result, pow((double)Z_LVAL_P(op1), Z_DVAL_P(op2))); in pow_function_base()
1230 ZVAL_DOUBLE(result, pow(Z_DVAL_P(op1), (double)Z_LVAL_P(op2))); in pow_function_base()
1238 ZEND_API zend_result ZEND_FASTCALL pow_function(zval *result, zval *op1, zval *op2) /* {{{ */ in pow_function() argument
1240 ZVAL_DEREF(op1); in pow_function()
1242 if (pow_function_base(result, op1, op2) == SUCCESS) { in pow_function()
1249 if (UNEXPECTED(zendi_try_convert_scalar_to_number(op1, &op1_copy) == FAILURE) in pow_function()
1251 zend_binop_error("**", op1, op2); in pow_function()
1252 if (result != op1) { in pow_function()
1258 if (result == op1) { in pow_function()
1274 static int ZEND_FASTCALL div_function_base(zval *result, zval *op1, zval *op2) /* {{{ */ in div_function_base() argument
1276 zend_uchar type_pair = TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2)); in div_function_base()
1281 } else if (Z_LVAL_P(op2) == -1 && Z_LVAL_P(op1) == ZEND_LONG_MIN) { in div_function_base()
1286 if (Z_LVAL_P(op1) % Z_LVAL_P(op2) == 0) { /* integer */ in div_function_base()
1287 ZVAL_LONG(result, Z_LVAL_P(op1) / Z_LVAL_P(op2)); in div_function_base()
1289 ZVAL_DOUBLE(result, ((double) Z_LVAL_P(op1)) / Z_LVAL_P(op2)); in div_function_base()
1296 ZVAL_DOUBLE(result, Z_DVAL_P(op1) / Z_DVAL_P(op2)); in div_function_base()
1302 ZVAL_DOUBLE(result, Z_DVAL_P(op1) / (double)Z_LVAL_P(op2)); in div_function_base()
1308 ZVAL_DOUBLE(result, (double)Z_LVAL_P(op1) / Z_DVAL_P(op2)); in div_function_base()
1316 ZEND_API zend_result ZEND_FASTCALL div_function(zval *result, zval *op1, zval *op2) /* {{{ */ in div_function() argument
1318 ZVAL_DEREF(op1); in div_function()
1321 int retval = div_function_base(result, op1, op2); in div_function()
1333 if (UNEXPECTED(zendi_try_convert_scalar_to_number(op1, &op1_copy) == FAILURE) in div_function()
1335 zend_binop_error("/", op1, op2); in div_function()
1336 if (result != op1) { in div_function()
1344 if (result == op1) { in div_function()
1353 if (result != op1) { in div_function()
1361 ZEND_API zend_result ZEND_FASTCALL mod_function(zval *result, zval *op1, zval *op2) /* {{{ */ in mod_function() argument
1365 convert_op1_op2_long(op1, op1_lval, op2, op2_lval, result, ZEND_MOD, "%"); in mod_function()
1374 if (op1 != result) { in mod_function()
1380 if (op1 == result) { in mod_function()
1395 ZEND_API zend_result ZEND_FASTCALL boolean_xor_function(zval *result, zval *op1, zval *op2) /* {{{ … in boolean_xor_function() argument
1400 if (Z_TYPE_P(op1) == IS_FALSE) { in boolean_xor_function()
1402 } else if (EXPECTED(Z_TYPE_P(op1) == IS_TRUE)) { in boolean_xor_function()
1405 if (Z_ISREF_P(op1)) { in boolean_xor_function()
1406 op1 = Z_REFVAL_P(op1); in boolean_xor_function()
1407 if (Z_TYPE_P(op1) == IS_FALSE) { in boolean_xor_function()
1410 } else if (EXPECTED(Z_TYPE_P(op1) == IS_TRUE)) { in boolean_xor_function()
1416 op1_val = zval_is_true(op1); in boolean_xor_function()
1445 ZEND_API zend_result ZEND_FASTCALL boolean_not_function(zval *result, zval *op1) /* {{{ */ in boolean_not_function() argument
1447 if (Z_TYPE_P(op1) < IS_TRUE) { in boolean_not_function()
1449 } else if (EXPECTED(Z_TYPE_P(op1) == IS_TRUE)) { in boolean_not_function()
1452 if (Z_ISREF_P(op1)) { in boolean_not_function()
1453 op1 = Z_REFVAL_P(op1); in boolean_not_function()
1454 if (Z_TYPE_P(op1) < IS_TRUE) { in boolean_not_function()
1457 } else if (EXPECTED(Z_TYPE_P(op1) == IS_TRUE)) { in boolean_not_function()
1464 ZVAL_BOOL(result, !zval_is_true(op1)); in boolean_not_function()
1470 ZEND_API zend_result ZEND_FASTCALL bitwise_not_function(zval *result, zval *op1) /* {{{ */ in bitwise_not_function() argument
1473 switch (Z_TYPE_P(op1)) { in bitwise_not_function()
1475 ZVAL_LONG(result, ~Z_LVAL_P(op1)); in bitwise_not_function()
1478 zend_long lval = zend_dval_to_lval(Z_DVAL_P(op1)); in bitwise_not_function()
1479 if (!zend_is_long_compatible(Z_DVAL_P(op1), lval)) { in bitwise_not_function()
1480 zend_incompatible_double_to_long_error(Z_DVAL_P(op1)); in bitwise_not_function()
1482 if (result != op1) { in bitwise_not_function()
1494 if (Z_STRLEN_P(op1) == 1) { in bitwise_not_function()
1495 zend_uchar not = (zend_uchar) ~*Z_STRVAL_P(op1); in bitwise_not_function()
1498 ZVAL_NEW_STR(result, zend_string_alloc(Z_STRLEN_P(op1), 0)); in bitwise_not_function()
1499 for (i = 0; i < Z_STRLEN_P(op1); i++) { in bitwise_not_function()
1500 Z_STRVAL_P(result)[i] = ~Z_STRVAL_P(op1)[i]; in bitwise_not_function()
1507 op1 = Z_REFVAL_P(op1); in bitwise_not_function()
1512 if (result != op1) { in bitwise_not_function()
1515 zend_type_error("Cannot perform bitwise not on %s", zend_zval_type_name(op1)); in bitwise_not_function()
1521 ZEND_API zend_result ZEND_FASTCALL bitwise_or_function(zval *result, zval *op1, zval *op2) /* {{{ */ in bitwise_or_function() argument
1525 if (EXPECTED(Z_TYPE_P(op1) == IS_LONG) && EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { in bitwise_or_function()
1526 ZVAL_LONG(result, Z_LVAL_P(op1) | Z_LVAL_P(op2)); in bitwise_or_function()
1530 ZVAL_DEREF(op1); in bitwise_or_function()
1533 if (Z_TYPE_P(op1) == IS_STRING && EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { in bitwise_or_function()
1538 if (EXPECTED(Z_STRLEN_P(op1) >= Z_STRLEN_P(op2))) { in bitwise_or_function()
1539 if (EXPECTED(Z_STRLEN_P(op1) == Z_STRLEN_P(op2)) && Z_STRLEN_P(op1) == 1) { in bitwise_or_function()
1540 zend_uchar or = (zend_uchar) (*Z_STRVAL_P(op1) | *Z_STRVAL_P(op2)); in bitwise_or_function()
1541 if (result==op1) { in bitwise_or_function()
1547 longer = op1; in bitwise_or_function()
1551 shorter = op1; in bitwise_or_function()
1559 if (result==op1) { in bitwise_or_function()
1566 if (UNEXPECTED(Z_TYPE_P(op1) != IS_LONG)) { in bitwise_or_function()
1569 op1_lval = zendi_try_get_long(op1, &failed); in bitwise_or_function()
1571 zend_binop_error("|", op1, op2); in bitwise_or_function()
1572 if (result != op1) { in bitwise_or_function()
1578 op1_lval = Z_LVAL_P(op1); in bitwise_or_function()
1585 zend_binop_error("|", op1, op2); in bitwise_or_function()
1586 if (result != op1) { in bitwise_or_function()
1595 if (op1 == result) { in bitwise_or_function()
1603 ZEND_API zend_result ZEND_FASTCALL bitwise_and_function(zval *result, zval *op1, zval *op2) /* {{{ … in bitwise_and_function() argument
1607 if (EXPECTED(Z_TYPE_P(op1) == IS_LONG) && EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { in bitwise_and_function()
1608 ZVAL_LONG(result, Z_LVAL_P(op1) & Z_LVAL_P(op2)); in bitwise_and_function()
1612 ZVAL_DEREF(op1); in bitwise_and_function()
1615 if (Z_TYPE_P(op1) == IS_STRING && Z_TYPE_P(op2) == IS_STRING) { in bitwise_and_function()
1620 if (EXPECTED(Z_STRLEN_P(op1) >= Z_STRLEN_P(op2))) { in bitwise_and_function()
1621 if (EXPECTED(Z_STRLEN_P(op1) == Z_STRLEN_P(op2)) && Z_STRLEN_P(op1) == 1) { in bitwise_and_function()
1622 zend_uchar and = (zend_uchar) (*Z_STRVAL_P(op1) & *Z_STRVAL_P(op2)); in bitwise_and_function()
1623 if (result==op1) { in bitwise_and_function()
1629 longer = op1; in bitwise_and_function()
1633 shorter = op1; in bitwise_and_function()
1641 if (result==op1) { in bitwise_and_function()
1648 if (UNEXPECTED(Z_TYPE_P(op1) != IS_LONG)) { in bitwise_and_function()
1651 op1_lval = zendi_try_get_long(op1, &failed); in bitwise_and_function()
1653 zend_binop_error("&", op1, op2); in bitwise_and_function()
1654 if (result != op1) { in bitwise_and_function()
1660 op1_lval = Z_LVAL_P(op1); in bitwise_and_function()
1667 zend_binop_error("&", op1, op2); in bitwise_and_function()
1668 if (result != op1) { in bitwise_and_function()
1677 if (op1 == result) { in bitwise_and_function()
1685 ZEND_API zend_result ZEND_FASTCALL bitwise_xor_function(zval *result, zval *op1, zval *op2) /* {{{ … in bitwise_xor_function() argument
1689 if (EXPECTED(Z_TYPE_P(op1) == IS_LONG) && EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { in bitwise_xor_function()
1690 ZVAL_LONG(result, Z_LVAL_P(op1) ^ Z_LVAL_P(op2)); in bitwise_xor_function()
1694 ZVAL_DEREF(op1); in bitwise_xor_function()
1697 if (Z_TYPE_P(op1) == IS_STRING && Z_TYPE_P(op2) == IS_STRING) { in bitwise_xor_function()
1702 if (EXPECTED(Z_STRLEN_P(op1) >= Z_STRLEN_P(op2))) { in bitwise_xor_function()
1703 if (EXPECTED(Z_STRLEN_P(op1) == Z_STRLEN_P(op2)) && Z_STRLEN_P(op1) == 1) { in bitwise_xor_function()
1704 zend_uchar xor = (zend_uchar) (*Z_STRVAL_P(op1) ^ *Z_STRVAL_P(op2)); in bitwise_xor_function()
1705 if (result==op1) { in bitwise_xor_function()
1711 longer = op1; in bitwise_xor_function()
1715 shorter = op1; in bitwise_xor_function()
1723 if (result==op1) { in bitwise_xor_function()
1730 if (UNEXPECTED(Z_TYPE_P(op1) != IS_LONG)) { in bitwise_xor_function()
1733 op1_lval = zendi_try_get_long(op1, &failed); in bitwise_xor_function()
1735 zend_binop_error("^", op1, op2); in bitwise_xor_function()
1736 if (result != op1) { in bitwise_xor_function()
1742 op1_lval = Z_LVAL_P(op1); in bitwise_xor_function()
1749 zend_binop_error("^", op1, op2); in bitwise_xor_function()
1750 if (result != op1) { in bitwise_xor_function()
1759 if (op1 == result) { in bitwise_xor_function()
1767 ZEND_API zend_result ZEND_FASTCALL shift_left_function(zval *result, zval *op1, zval *op2) /* {{{ */ in shift_left_function() argument
1771 convert_op1_op2_long(op1, op1_lval, op2, op2_lval, result, ZEND_SL, "<<"); in shift_left_function()
1776 if (op1 == result) { in shift_left_function()
1787 if (op1 != result) { in shift_left_function()
1794 if (op1 == result) { in shift_left_function()
1804 ZEND_API zend_result ZEND_FASTCALL shift_right_function(zval *result, zval *op1, zval *op2) /* {{{ … in shift_right_function() argument
1808 convert_op1_op2_long(op1, op1_lval, op2, op2_lval, result, ZEND_SR, ">>"); in shift_right_function()
1813 if (op1 == result) { in shift_right_function()
1824 if (op1 != result) { in shift_right_function()
1831 if (op1 == result) { in shift_right_function()
1840 ZEND_API zend_result ZEND_FASTCALL concat_function(zval *result, zval *op1, zval *op2) /* {{{ */ in concat_function() argument
1842 zval *orig_op1 = op1; in concat_function()
1849 if (UNEXPECTED(Z_TYPE_P(op1) != IS_STRING)) { in concat_function()
1850 if (Z_ISREF_P(op1)) { in concat_function()
1851 op1 = Z_REFVAL_P(op1); in concat_function()
1852 if (Z_TYPE_P(op1) == IS_STRING) break; in concat_function()
1855 ZVAL_STR(&op1_copy, zval_get_string_func(op1)); in concat_function()
1863 if (result == op1) { in concat_function()
1864 if (UNEXPECTED(op1 == op2)) { in concat_function()
1868 op1 = &op1_copy; in concat_function()
1891 if (UNEXPECTED(Z_STRLEN_P(op1) == 0)) { in concat_function()
1899 if (EXPECTED(result != op1)) { in concat_function()
1903 ZVAL_COPY(result, op1); in concat_function()
1906 size_t op1_len = Z_STRLEN_P(op1); in concat_function()
1921 if (result == op1 && Z_REFCOUNTED_P(result)) { in concat_function()
1926 memcpy(ZSTR_VAL(result_str), Z_STRVAL_P(op1), op1_len); in concat_function()
1947 ZEND_API int ZEND_FASTCALL string_compare_function_ex(zval *op1, zval *op2, bool case_insensitive) … in string_compare_function_ex() argument
1950 zend_string *str1 = zval_get_tmp_string(op1, &tmp_str1); in string_compare_function_ex()
1966 ZEND_API int ZEND_FASTCALL string_compare_function(zval *op1, zval *op2) /* {{{ */ in string_compare_function() argument
1968 if (EXPECTED(Z_TYPE_P(op1) == IS_STRING) && in string_compare_function()
1970 if (Z_STR_P(op1) == Z_STR_P(op2)) { in string_compare_function()
1973 return zend_binary_strcmp(Z_STRVAL_P(op1), Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2)); in string_compare_function()
1977 zend_string *str1 = zval_get_tmp_string(op1, &tmp_str1); in string_compare_function()
1988 ZEND_API int ZEND_FASTCALL string_case_compare_function(zval *op1, zval *op2) /* {{{ */ in string_case_compare_function() argument
1990 if (EXPECTED(Z_TYPE_P(op1) == IS_STRING) && in string_case_compare_function()
1992 if (Z_STR_P(op1) == Z_STR_P(op2)) { in string_case_compare_function()
1995 …return 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()
1999 zend_string *str1 = zval_get_tmp_string(op1, &tmp_str1); in string_case_compare_function()
2010 ZEND_API int ZEND_FASTCALL string_locale_compare_function(zval *op1, zval *op2) /* {{{ */ in string_locale_compare_function() argument
2013 zend_string *str1 = zval_get_tmp_string(op1, &tmp_str1); in string_locale_compare_function()
2023 ZEND_API int ZEND_FASTCALL numeric_compare_function(zval *op1, zval *op2) /* {{{ */ in numeric_compare_function() argument
2027 d1 = zval_get_double(op1); in numeric_compare_function()
2034 ZEND_API zend_result ZEND_FASTCALL compare_function(zval *result, zval *op1, zval *op2) /* {{{ */ in compare_function() argument
2036 ZVAL_LONG(result, zend_compare(op1, op2)); in compare_function()
2090 ZEND_API int ZEND_FASTCALL zend_compare(zval *op1, zval *op2) /* {{{ */ in zend_compare() argument
2096 switch (TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2))) { in zend_compare()
2098 return Z_LVAL_P(op1)>Z_LVAL_P(op2)?1:(Z_LVAL_P(op1)<Z_LVAL_P(op2)?-1:0); in zend_compare()
2101 return ZEND_NORMALIZE_BOOL(Z_DVAL_P(op1) - (double)Z_LVAL_P(op2)); in zend_compare()
2104 return ZEND_NORMALIZE_BOOL((double)Z_LVAL_P(op1) - Z_DVAL_P(op2)); in zend_compare()
2107 if (Z_DVAL_P(op1) == Z_DVAL_P(op2)) { in zend_compare()
2110 return ZEND_NORMALIZE_BOOL(Z_DVAL_P(op1) - Z_DVAL_P(op2)); in zend_compare()
2114 return zend_compare_arrays(op1, op2); in zend_compare()
2130 if (Z_STR_P(op1) == Z_STR_P(op2)) { in zend_compare()
2133 return zendi_smart_strcmp(Z_STR_P(op1), Z_STR_P(op2)); in zend_compare()
2139 return Z_STRLEN_P(op1) == 0 ? 0 : 1; in zend_compare()
2142 return compare_long_to_string(Z_LVAL_P(op1), Z_STR_P(op2)); in zend_compare()
2145 return -compare_long_to_string(Z_LVAL_P(op2), Z_STR_P(op1)); in zend_compare()
2148 if (zend_isnan(Z_DVAL_P(op1))) { in zend_compare()
2152 return compare_double_to_string(Z_DVAL_P(op1), Z_STR_P(op2)); in zend_compare()
2159 return -compare_double_to_string(Z_DVAL_P(op2), Z_STR_P(op1)); in zend_compare()
2168 if (Z_ISREF_P(op1)) { in zend_compare()
2169 op1 = Z_REFVAL_P(op1); in zend_compare()
2176 if (Z_TYPE_P(op1) == IS_OBJECT in zend_compare()
2178 && Z_OBJ_P(op1) == Z_OBJ_P(op2)) { in zend_compare()
2180 } else if (Z_TYPE_P(op1) == IS_OBJECT) { in zend_compare()
2181 return Z_OBJ_HANDLER_P(op1, compare)(op1, op2); in zend_compare()
2183 return Z_OBJ_HANDLER_P(op2, compare)(op1, op2); in zend_compare()
2187 if (Z_TYPE_P(op1) < IS_TRUE) { in zend_compare()
2189 } else if (Z_TYPE_P(op1) == IS_TRUE) { in zend_compare()
2192 return zval_is_true(op1) ? 1 : 0; in zend_compare()
2194 return zval_is_true(op1) ? 0 : -1; in zend_compare()
2196 op1 = _zendi_convert_scalar_to_number_silent(op1, &op1_copy); in zend_compare()
2203 } else if (Z_TYPE_P(op1)==IS_ARRAY) { in zend_compare()
2231 ZEND_API bool ZEND_FASTCALL zend_is_identical(zval *op1, zval *op2) /* {{{ */ in zend_is_identical() argument
2233 if (Z_TYPE_P(op1) != Z_TYPE_P(op2)) { in zend_is_identical()
2236 switch (Z_TYPE_P(op1)) { in zend_is_identical()
2242 return (Z_LVAL_P(op1) == Z_LVAL_P(op2)); in zend_is_identical()
2244 return (Z_RES_P(op1) == Z_RES_P(op2)); in zend_is_identical()
2246 return (Z_DVAL_P(op1) == Z_DVAL_P(op2)); in zend_is_identical()
2248 return zend_string_equals(Z_STR_P(op1), Z_STR_P(op2)); in zend_is_identical()
2250 return (Z_ARRVAL_P(op1) == Z_ARRVAL_P(op2) || in zend_is_identical()
2251 …zend_hash_compare(Z_ARRVAL_P(op1), Z_ARRVAL_P(op2), (compare_func_t) hash_zval_identical_function,… in zend_is_identical()
2253 return (Z_OBJ_P(op1) == Z_OBJ_P(op2)); in zend_is_identical()
2260 ZEND_API zend_result ZEND_FASTCALL is_identical_function(zval *result, zval *op1, zval *op2) /* {{{… in is_identical_function() argument
2262 ZVAL_BOOL(result, zend_is_identical(op1, op2)); in is_identical_function()
2267 ZEND_API zend_result ZEND_FASTCALL is_not_identical_function(zval *result, zval *op1, zval *op2) /*… in is_not_identical_function() argument
2269 ZVAL_BOOL(result, !zend_is_identical(op1, op2)); in is_not_identical_function()
2274 ZEND_API zend_result ZEND_FASTCALL is_equal_function(zval *result, zval *op1, zval *op2) /* {{{ */ in is_equal_function() argument
2276 ZVAL_BOOL(result, zend_compare(op1, op2) == 0); in is_equal_function()
2281 ZEND_API zend_result ZEND_FASTCALL is_not_equal_function(zval *result, zval *op1, zval *op2) /* {{{… in is_not_equal_function() argument
2283 ZVAL_BOOL(result, (zend_compare(op1, op2) != 0)); in is_not_equal_function()
2288 ZEND_API zend_result ZEND_FASTCALL is_smaller_function(zval *result, zval *op1, zval *op2) /* {{{ */ in is_smaller_function() argument
2290 ZVAL_BOOL(result, (zend_compare(op1, op2) < 0)); in is_smaller_function()
2295 ZEND_API zend_result ZEND_FASTCALL is_smaller_or_equal_function(zval *result, zval *op1, zval *op2)… in is_smaller_or_equal_function() argument
2297 ZVAL_BOOL(result, (zend_compare(op1, op2) <= 0)); in is_smaller_or_equal_function()
2439 ZEND_API zend_result ZEND_FASTCALL increment_function(zval *op1) /* {{{ */ in increment_function() argument
2442 switch (Z_TYPE_P(op1)) { in increment_function()
2444 fast_long_increment_function(op1); in increment_function()
2447 Z_DVAL_P(op1) = Z_DVAL_P(op1) + 1; in increment_function()
2450 ZVAL_LONG(op1, 1); in increment_function()
2456 switch (is_numeric_str_function(Z_STR_P(op1), &lval, &dval)) { in increment_function()
2458 zval_ptr_dtor_str(op1); in increment_function()
2462 ZVAL_DOUBLE(op1, d+1); in increment_function()
2464 ZVAL_LONG(op1, lval+1); in increment_function()
2468 zval_ptr_dtor_str(op1); in increment_function()
2469 ZVAL_DOUBLE(op1, dval+1); in increment_function()
2473 increment_string(op1); in increment_function()
2483 op1 = Z_REFVAL_P(op1); in increment_function()
2486 if (Z_OBJ_HANDLER_P(op1, do_operation)) { in increment_function()
2489 if (Z_OBJ_HANDLER_P(op1, do_operation)(ZEND_ADD, op1, op1, &op2) == SUCCESS) { in increment_function()
2496 zend_type_error("Cannot increment %s", zend_zval_type_name(op1)); in increment_function()
2504 ZEND_API zend_result ZEND_FASTCALL decrement_function(zval *op1) /* {{{ */ in decrement_function() argument
2510 switch (Z_TYPE_P(op1)) { in decrement_function()
2512 fast_long_decrement_function(op1); in decrement_function()
2515 Z_DVAL_P(op1) = Z_DVAL_P(op1) - 1; in decrement_function()
2518 if (Z_STRLEN_P(op1) == 0) { /* consider as 0 */ in decrement_function()
2519 zval_ptr_dtor_str(op1); in decrement_function()
2520 ZVAL_LONG(op1, -1); in decrement_function()
2523 switch (is_numeric_str_function(Z_STR_P(op1), &lval, &dval)) { in decrement_function()
2525 zval_ptr_dtor_str(op1); in decrement_function()
2528 ZVAL_DOUBLE(op1, d-1); in decrement_function()
2530 ZVAL_LONG(op1, lval-1); in decrement_function()
2534 zval_ptr_dtor_str(op1); in decrement_function()
2535 ZVAL_DOUBLE(op1, dval - 1); in decrement_function()
2545 op1 = Z_REFVAL_P(op1); in decrement_function()
2548 if (Z_OBJ_HANDLER_P(op1, do_operation)) { in decrement_function()
2551 if (Z_OBJ_HANDLER_P(op1, do_operation)(ZEND_SUB, op1, op1, &op2) == SUCCESS) { in decrement_function()
2558 zend_type_error("Cannot decrement %s", zend_zval_type_name(op1)); in decrement_function()