Lines Matching refs:op1

351 	if (UNEXPECTED(Z_TYPE_P(op1) == IS_OBJECT) \
352 && UNEXPECTED(Z_OBJ_HANDLER_P(op1, do_operation))) { \
353 if (EXPECTED(SUCCESS == Z_OBJ_HANDLER_P(op1, do_operation)(opcode, result, op1, op2))) { \
361 && EXPECTED(SUCCESS == Z_OBJ_HANDLER_P(op2, do_operation)(opcode, result, op1, op2))) { \
371 if (UNEXPECTED(Z_TYPE_P(op1) == IS_OBJECT) \
372 && UNEXPECTED(Z_OBJ_HANDLER_P(op1, do_operation)) \
373 && EXPECTED(SUCCESS == Z_OBJ_HANDLER_P(op1, do_operation)(opcode, result, op1, NULL))) { \
377 #define convert_op1_op2_long(op1, op1_lval, op2, op2_lval, result, opcode, sigil) \ argument
379 if (UNEXPECTED(Z_TYPE_P(op1) != IS_LONG)) { \
381 if (Z_ISREF_P(op1)) { \
382 op1 = Z_REFVAL_P(op1); \
383 if (Z_TYPE_P(op1) == IS_LONG) { \
384 op1_lval = Z_LVAL_P(op1); \
389 op1_lval = zendi_try_get_long(op1, &failed); \
391 zend_binop_error(sigil, op1, op2); \
392 if (result != op1) { \
398 op1_lval = Z_LVAL_P(op1); \
414 zend_binop_error(sigil, op1, op2); \
415 if (result != op1) { \
941 …ver_inline void ZEND_FASTCALL zend_binop_error(const char *operator, zval *op1, zval *op2) /* {{{ … in zend_binop_error() argument
947 zend_zval_type_name(op1), operator, zend_zval_type_name(op2)); in zend_binop_error()
951 static zend_never_inline void ZEND_FASTCALL add_function_array(zval *result, zval *op1, zval *op2) … in add_function_array() argument
953 if (result == op1 && Z_ARR_P(op1) == Z_ARR_P(op2)) { in add_function_array()
957 if (result != op1) { in add_function_array()
958 ZVAL_ARR(result, zend_array_dup(Z_ARR_P(op1))); in add_function_array()
966 static zend_always_inline zend_result add_function_fast(zval *result, zval *op1, zval *op2) /* {{{ … in add_function_fast() argument
968 zend_uchar type_pair = TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2)); in add_function_fast()
971 fast_long_add_function(result, op1, op2); in add_function_fast()
974 ZVAL_DOUBLE(result, Z_DVAL_P(op1) + Z_DVAL_P(op2)); in add_function_fast()
977 ZVAL_DOUBLE(result, ((double)Z_LVAL_P(op1)) + Z_DVAL_P(op2)); in add_function_fast()
980 ZVAL_DOUBLE(result, Z_DVAL_P(op1) + ((double)Z_LVAL_P(op2))); in add_function_fast()
983 add_function_array(result, op1, op2); in add_function_fast()
990 static zend_never_inline zend_result ZEND_FASTCALL add_function_slow(zval *result, zval *op1, zval … in add_function_slow() argument
992 ZVAL_DEREF(op1); in add_function_slow()
994 if (add_function_fast(result, op1, op2) == SUCCESS) { in add_function_slow()
1001 if (UNEXPECTED(zendi_try_convert_scalar_to_number(op1, &op1_copy) == FAILURE) in add_function_slow()
1003 zend_binop_error("+", op1, op2); in add_function_slow()
1004 if (result != op1) { in add_function_slow()
1010 if (result == op1) { in add_function_slow()
1022 ZEND_API zend_result ZEND_FASTCALL add_function(zval *result, zval *op1, zval *op2) /* {{{ */ in add_function() argument
1024 if (add_function_fast(result, op1, op2) == SUCCESS) { in add_function()
1027 return add_function_slow(result, op1, op2); in add_function()
1032 static zend_always_inline zend_result sub_function_fast(zval *result, zval *op1, zval *op2) /* {{{ … in sub_function_fast() argument
1034 zend_uchar type_pair = TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2)); in sub_function_fast()
1037 fast_long_sub_function(result, op1, op2); in sub_function_fast()
1040 ZVAL_DOUBLE(result, Z_DVAL_P(op1) - Z_DVAL_P(op2)); in sub_function_fast()
1043 ZVAL_DOUBLE(result, ((double)Z_LVAL_P(op1)) - Z_DVAL_P(op2)); in sub_function_fast()
1046 ZVAL_DOUBLE(result, Z_DVAL_P(op1) - ((double)Z_LVAL_P(op2))); in sub_function_fast()
1054 static zend_never_inline zend_result ZEND_FASTCALL sub_function_slow(zval *result, zval *op1, zval … in sub_function_slow() argument
1056 ZVAL_DEREF(op1); in sub_function_slow()
1058 if (sub_function_fast(result, op1, op2) == SUCCESS) { in sub_function_slow()
1065 if (UNEXPECTED(zendi_try_convert_scalar_to_number(op1, &op1_copy) == FAILURE) in sub_function_slow()
1067 zend_binop_error("-", op1, op2); in sub_function_slow()
1068 if (result != op1) { in sub_function_slow()
1074 if (result == op1) { in sub_function_slow()
1087 ZEND_API zend_result ZEND_FASTCALL sub_function(zval *result, zval *op1, zval *op2) /* {{{ */ in sub_function() argument
1089 if (sub_function_fast(result, op1, op2) == SUCCESS) { in sub_function()
1092 return sub_function_slow(result, op1, op2); in sub_function()
1097 static zend_always_inline zend_result mul_function_fast(zval *result, zval *op1, zval *op2) /* {{{ … in mul_function_fast() argument
1099 zend_uchar type_pair = TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2)); in mul_function_fast()
1104 Z_LVAL_P(op1), Z_LVAL_P(op2), in mul_function_fast()
1109 ZVAL_DOUBLE(result, Z_DVAL_P(op1) * Z_DVAL_P(op2)); in mul_function_fast()
1112 ZVAL_DOUBLE(result, ((double)Z_LVAL_P(op1)) * Z_DVAL_P(op2)); in mul_function_fast()
1115 ZVAL_DOUBLE(result, Z_DVAL_P(op1) * ((double)Z_LVAL_P(op2))); in mul_function_fast()
1123 static zend_never_inline zend_result ZEND_FASTCALL mul_function_slow(zval *result, zval *op1, zval … in mul_function_slow() argument
1125 ZVAL_DEREF(op1); in mul_function_slow()
1127 if (mul_function_fast(result, op1, op2) == SUCCESS) { in mul_function_slow()
1134 if (UNEXPECTED(zendi_try_convert_scalar_to_number(op1, &op1_copy) == FAILURE) in mul_function_slow()
1136 zend_binop_error("*", op1, op2); in mul_function_slow()
1137 if (result != op1) { in mul_function_slow()
1143 if (result == op1) { in mul_function_slow()
1156 ZEND_API zend_result ZEND_FASTCALL mul_function(zval *result, zval *op1, zval *op2) /* {{{ */ in mul_function() argument
1158 if (mul_function_fast(result, op1, op2) == SUCCESS) { in mul_function()
1161 return mul_function_slow(result, op1, op2); in mul_function()
1166 static zend_result ZEND_FASTCALL pow_function_base(zval *result, zval *op1, zval *op2) /* {{{ */ in pow_function_base() argument
1168 zend_uchar type_pair = TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2)); in pow_function_base()
1172 zend_long l1 = 1, l2 = Z_LVAL_P(op1), i = Z_LVAL_P(op2); in pow_function_base()
1205 ZVAL_DOUBLE(result, pow((double)Z_LVAL_P(op1), (double)Z_LVAL_P(op2))); in pow_function_base()
1209 ZVAL_DOUBLE(result, pow(Z_DVAL_P(op1), Z_DVAL_P(op2))); in pow_function_base()
1212 ZVAL_DOUBLE(result, pow((double)Z_LVAL_P(op1), Z_DVAL_P(op2))); in pow_function_base()
1215 ZVAL_DOUBLE(result, pow(Z_DVAL_P(op1), (double)Z_LVAL_P(op2))); in pow_function_base()
1223 ZEND_API zend_result ZEND_FASTCALL pow_function(zval *result, zval *op1, zval *op2) /* {{{ */ in pow_function() argument
1225 ZVAL_DEREF(op1); in pow_function()
1227 if (pow_function_base(result, op1, op2) == SUCCESS) { in pow_function()
1234 if (UNEXPECTED(zendi_try_convert_scalar_to_number(op1, &op1_copy) == FAILURE) in pow_function()
1236 zend_binop_error("**", op1, op2); in pow_function()
1237 if (result != op1) { in pow_function()
1243 if (result == op1) { in pow_function()
1259 static int ZEND_FASTCALL div_function_base(zval *result, zval *op1, zval *op2) /* {{{ */ in div_function_base() argument
1261 zend_uchar type_pair = TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2)); in div_function_base()
1266 } else if (Z_LVAL_P(op2) == -1 && Z_LVAL_P(op1) == ZEND_LONG_MIN) { in div_function_base()
1271 if (Z_LVAL_P(op1) % Z_LVAL_P(op2) == 0) { /* integer */ in div_function_base()
1272 ZVAL_LONG(result, Z_LVAL_P(op1) / Z_LVAL_P(op2)); in div_function_base()
1274 ZVAL_DOUBLE(result, ((double) Z_LVAL_P(op1)) / Z_LVAL_P(op2)); in div_function_base()
1281 ZVAL_DOUBLE(result, Z_DVAL_P(op1) / Z_DVAL_P(op2)); in div_function_base()
1287 ZVAL_DOUBLE(result, Z_DVAL_P(op1) / (double)Z_LVAL_P(op2)); in div_function_base()
1293 ZVAL_DOUBLE(result, (double)Z_LVAL_P(op1) / Z_DVAL_P(op2)); in div_function_base()
1301 ZEND_API zend_result ZEND_FASTCALL div_function(zval *result, zval *op1, zval *op2) /* {{{ */ in div_function() argument
1303 ZVAL_DEREF(op1); in div_function()
1306 int retval = div_function_base(result, op1, op2); in div_function()
1318 if (UNEXPECTED(zendi_try_convert_scalar_to_number(op1, &op1_copy) == FAILURE) in div_function()
1320 zend_binop_error("/", op1, op2); in div_function()
1321 if (result != op1) { in div_function()
1329 if (result == op1) { in div_function()
1338 if (result != op1) { in div_function()
1346 ZEND_API zend_result ZEND_FASTCALL mod_function(zval *result, zval *op1, zval *op2) /* {{{ */ in mod_function() argument
1350 convert_op1_op2_long(op1, op1_lval, op2, op2_lval, result, ZEND_MOD, "%"); in mod_function()
1359 if (op1 != result) { in mod_function()
1365 if (op1 == result) { in mod_function()
1380 ZEND_API zend_result ZEND_FASTCALL boolean_xor_function(zval *result, zval *op1, zval *op2) /* {{{ … in boolean_xor_function() argument
1385 if (Z_TYPE_P(op1) == IS_FALSE) { in boolean_xor_function()
1387 } else if (EXPECTED(Z_TYPE_P(op1) == IS_TRUE)) { in boolean_xor_function()
1390 if (Z_ISREF_P(op1)) { in boolean_xor_function()
1391 op1 = Z_REFVAL_P(op1); in boolean_xor_function()
1392 if (Z_TYPE_P(op1) == IS_FALSE) { in boolean_xor_function()
1395 } else if (EXPECTED(Z_TYPE_P(op1) == IS_TRUE)) { in boolean_xor_function()
1401 op1_val = zval_is_true(op1); in boolean_xor_function()
1430 ZEND_API zend_result ZEND_FASTCALL boolean_not_function(zval *result, zval *op1) /* {{{ */ in boolean_not_function() argument
1432 if (Z_TYPE_P(op1) < IS_TRUE) { in boolean_not_function()
1434 } else if (EXPECTED(Z_TYPE_P(op1) == IS_TRUE)) { in boolean_not_function()
1437 if (Z_ISREF_P(op1)) { in boolean_not_function()
1438 op1 = Z_REFVAL_P(op1); in boolean_not_function()
1439 if (Z_TYPE_P(op1) < IS_TRUE) { in boolean_not_function()
1442 } else if (EXPECTED(Z_TYPE_P(op1) == IS_TRUE)) { in boolean_not_function()
1449 ZVAL_BOOL(result, !zval_is_true(op1)); in boolean_not_function()
1455 ZEND_API zend_result ZEND_FASTCALL bitwise_not_function(zval *result, zval *op1) /* {{{ */ in bitwise_not_function() argument
1458 switch (Z_TYPE_P(op1)) { in bitwise_not_function()
1460 ZVAL_LONG(result, ~Z_LVAL_P(op1)); in bitwise_not_function()
1463 ZVAL_LONG(result, ~zend_dval_to_lval(Z_DVAL_P(op1))); in bitwise_not_function()
1468 if (Z_STRLEN_P(op1) == 1) { in bitwise_not_function()
1469 zend_uchar not = (zend_uchar) ~*Z_STRVAL_P(op1); in bitwise_not_function()
1472 ZVAL_NEW_STR(result, zend_string_alloc(Z_STRLEN_P(op1), 0)); in bitwise_not_function()
1473 for (i = 0; i < Z_STRLEN_P(op1); i++) { in bitwise_not_function()
1474 Z_STRVAL_P(result)[i] = ~Z_STRVAL_P(op1)[i]; in bitwise_not_function()
1481 op1 = Z_REFVAL_P(op1); in bitwise_not_function()
1486 if (result != op1) { in bitwise_not_function()
1489 zend_type_error("Cannot perform bitwise not on %s", zend_zval_type_name(op1)); in bitwise_not_function()
1495 ZEND_API zend_result ZEND_FASTCALL bitwise_or_function(zval *result, zval *op1, zval *op2) /* {{{ */ in bitwise_or_function() argument
1499 if (EXPECTED(Z_TYPE_P(op1) == IS_LONG) && EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { in bitwise_or_function()
1500 ZVAL_LONG(result, Z_LVAL_P(op1) | Z_LVAL_P(op2)); in bitwise_or_function()
1504 ZVAL_DEREF(op1); in bitwise_or_function()
1507 if (Z_TYPE_P(op1) == IS_STRING && EXPECTED(Z_TYPE_P(op2) == IS_STRING)) { in bitwise_or_function()
1512 if (EXPECTED(Z_STRLEN_P(op1) >= Z_STRLEN_P(op2))) { in bitwise_or_function()
1513 if (EXPECTED(Z_STRLEN_P(op1) == Z_STRLEN_P(op2)) && Z_STRLEN_P(op1) == 1) { in bitwise_or_function()
1514 zend_uchar or = (zend_uchar) (*Z_STRVAL_P(op1) | *Z_STRVAL_P(op2)); in bitwise_or_function()
1515 if (result==op1) { in bitwise_or_function()
1521 longer = op1; in bitwise_or_function()
1525 shorter = op1; in bitwise_or_function()
1533 if (result==op1) { in bitwise_or_function()
1540 if (UNEXPECTED(Z_TYPE_P(op1) != IS_LONG)) { in bitwise_or_function()
1543 op1_lval = zendi_try_get_long(op1, &failed); in bitwise_or_function()
1545 zend_binop_error("|", op1, op2); in bitwise_or_function()
1546 if (result != op1) { in bitwise_or_function()
1552 op1_lval = Z_LVAL_P(op1); in bitwise_or_function()
1559 zend_binop_error("|", op1, op2); in bitwise_or_function()
1560 if (result != op1) { in bitwise_or_function()
1569 if (op1 == result) { in bitwise_or_function()
1577 ZEND_API zend_result ZEND_FASTCALL bitwise_and_function(zval *result, zval *op1, zval *op2) /* {{{ … in bitwise_and_function() argument
1581 if (EXPECTED(Z_TYPE_P(op1) == IS_LONG) && EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { in bitwise_and_function()
1582 ZVAL_LONG(result, Z_LVAL_P(op1) & Z_LVAL_P(op2)); in bitwise_and_function()
1586 ZVAL_DEREF(op1); in bitwise_and_function()
1589 if (Z_TYPE_P(op1) == IS_STRING && Z_TYPE_P(op2) == IS_STRING) { in bitwise_and_function()
1594 if (EXPECTED(Z_STRLEN_P(op1) >= Z_STRLEN_P(op2))) { in bitwise_and_function()
1595 if (EXPECTED(Z_STRLEN_P(op1) == Z_STRLEN_P(op2)) && Z_STRLEN_P(op1) == 1) { in bitwise_and_function()
1596 zend_uchar and = (zend_uchar) (*Z_STRVAL_P(op1) & *Z_STRVAL_P(op2)); in bitwise_and_function()
1597 if (result==op1) { in bitwise_and_function()
1603 longer = op1; in bitwise_and_function()
1607 shorter = op1; in bitwise_and_function()
1615 if (result==op1) { in bitwise_and_function()
1622 if (UNEXPECTED(Z_TYPE_P(op1) != IS_LONG)) { in bitwise_and_function()
1625 op1_lval = zendi_try_get_long(op1, &failed); in bitwise_and_function()
1627 zend_binop_error("&", op1, op2); in bitwise_and_function()
1628 if (result != op1) { in bitwise_and_function()
1634 op1_lval = Z_LVAL_P(op1); in bitwise_and_function()
1641 zend_binop_error("&", op1, op2); in bitwise_and_function()
1642 if (result != op1) { in bitwise_and_function()
1651 if (op1 == result) { in bitwise_and_function()
1659 ZEND_API zend_result ZEND_FASTCALL bitwise_xor_function(zval *result, zval *op1, zval *op2) /* {{{ … in bitwise_xor_function() argument
1663 if (EXPECTED(Z_TYPE_P(op1) == IS_LONG) && EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { in bitwise_xor_function()
1664 ZVAL_LONG(result, Z_LVAL_P(op1) ^ Z_LVAL_P(op2)); in bitwise_xor_function()
1668 ZVAL_DEREF(op1); in bitwise_xor_function()
1671 if (Z_TYPE_P(op1) == IS_STRING && Z_TYPE_P(op2) == IS_STRING) { in bitwise_xor_function()
1676 if (EXPECTED(Z_STRLEN_P(op1) >= Z_STRLEN_P(op2))) { in bitwise_xor_function()
1677 if (EXPECTED(Z_STRLEN_P(op1) == Z_STRLEN_P(op2)) && Z_STRLEN_P(op1) == 1) { in bitwise_xor_function()
1678 zend_uchar xor = (zend_uchar) (*Z_STRVAL_P(op1) ^ *Z_STRVAL_P(op2)); in bitwise_xor_function()
1679 if (result==op1) { in bitwise_xor_function()
1685 longer = op1; in bitwise_xor_function()
1689 shorter = op1; in bitwise_xor_function()
1697 if (result==op1) { in bitwise_xor_function()
1704 if (UNEXPECTED(Z_TYPE_P(op1) != IS_LONG)) { in bitwise_xor_function()
1707 op1_lval = zendi_try_get_long(op1, &failed); in bitwise_xor_function()
1709 zend_binop_error("^", op1, op2); in bitwise_xor_function()
1710 if (result != op1) { in bitwise_xor_function()
1716 op1_lval = Z_LVAL_P(op1); in bitwise_xor_function()
1723 zend_binop_error("^", op1, op2); in bitwise_xor_function()
1724 if (result != op1) { in bitwise_xor_function()
1733 if (op1 == result) { in bitwise_xor_function()
1741 ZEND_API zend_result ZEND_FASTCALL shift_left_function(zval *result, zval *op1, zval *op2) /* {{{ */ in shift_left_function() argument
1745 convert_op1_op2_long(op1, op1_lval, op2, op2_lval, result, ZEND_SL, "<<"); in shift_left_function()
1750 if (op1 == result) { in shift_left_function()
1761 if (op1 != result) { in shift_left_function()
1768 if (op1 == result) { in shift_left_function()
1778 ZEND_API zend_result ZEND_FASTCALL shift_right_function(zval *result, zval *op1, zval *op2) /* {{{ … in shift_right_function() argument
1782 convert_op1_op2_long(op1, op1_lval, op2, op2_lval, result, ZEND_SR, ">>"); in shift_right_function()
1787 if (op1 == result) { in shift_right_function()
1798 if (op1 != result) { in shift_right_function()
1805 if (op1 == result) { in shift_right_function()
1814 ZEND_API zend_result ZEND_FASTCALL concat_function(zval *result, zval *op1, zval *op2) /* {{{ */ in concat_function() argument
1816 zval *orig_op1 = op1; in concat_function()
1823 if (UNEXPECTED(Z_TYPE_P(op1) != IS_STRING)) { in concat_function()
1824 if (Z_ISREF_P(op1)) { in concat_function()
1825 op1 = Z_REFVAL_P(op1); in concat_function()
1826 if (Z_TYPE_P(op1) == IS_STRING) break; in concat_function()
1829 ZVAL_STR(&op1_copy, zval_get_string_func(op1)); in concat_function()
1837 if (result == op1) { in concat_function()
1838 if (UNEXPECTED(op1 == op2)) { in concat_function()
1842 op1 = &op1_copy; in concat_function()
1865 if (UNEXPECTED(Z_STRLEN_P(op1) == 0)) { in concat_function()
1873 if (EXPECTED(result != op1)) { in concat_function()
1877 ZVAL_COPY(result, op1); in concat_function()
1880 size_t op1_len = Z_STRLEN_P(op1); in concat_function()
1895 if (result == op1 && Z_REFCOUNTED_P(result)) { in concat_function()
1900 memcpy(ZSTR_VAL(result_str), Z_STRVAL_P(op1), op1_len); in concat_function()
1921 ZEND_API int ZEND_FASTCALL string_compare_function_ex(zval *op1, zval *op2, zend_bool case_insensit… in string_compare_function_ex() argument
1924 zend_string *str1 = zval_get_tmp_string(op1, &tmp_str1); in string_compare_function_ex()
1940 ZEND_API int ZEND_FASTCALL string_compare_function(zval *op1, zval *op2) /* {{{ */ in string_compare_function() argument
1942 if (EXPECTED(Z_TYPE_P(op1) == IS_STRING) && in string_compare_function()
1944 if (Z_STR_P(op1) == Z_STR_P(op2)) { in string_compare_function()
1947 return zend_binary_strcmp(Z_STRVAL_P(op1), Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2)); in string_compare_function()
1951 zend_string *str1 = zval_get_tmp_string(op1, &tmp_str1); in string_compare_function()
1962 ZEND_API int ZEND_FASTCALL string_case_compare_function(zval *op1, zval *op2) /* {{{ */ in string_case_compare_function() argument
1964 if (EXPECTED(Z_TYPE_P(op1) == IS_STRING) && in string_case_compare_function()
1966 if (Z_STR_P(op1) == Z_STR_P(op2)) { in string_case_compare_function()
1969 …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()
1973 zend_string *str1 = zval_get_tmp_string(op1, &tmp_str1); in string_case_compare_function()
1984 ZEND_API int ZEND_FASTCALL string_locale_compare_function(zval *op1, zval *op2) /* {{{ */ in string_locale_compare_function() argument
1987 zend_string *str1 = zval_get_tmp_string(op1, &tmp_str1); in string_locale_compare_function()
1997 ZEND_API int ZEND_FASTCALL numeric_compare_function(zval *op1, zval *op2) /* {{{ */ in numeric_compare_function() argument
2001 d1 = zval_get_double(op1); in numeric_compare_function()
2008 ZEND_API zend_result ZEND_FASTCALL compare_function(zval *result, zval *op1, zval *op2) /* {{{ */ in compare_function() argument
2010 ZVAL_LONG(result, zend_compare(op1, op2)); in compare_function()
2064 ZEND_API int ZEND_FASTCALL zend_compare(zval *op1, zval *op2) /* {{{ */ in zend_compare() argument
2070 switch (TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2))) { in zend_compare()
2072 return Z_LVAL_P(op1)>Z_LVAL_P(op2)?1:(Z_LVAL_P(op1)<Z_LVAL_P(op2)?-1:0); in zend_compare()
2075 return ZEND_NORMALIZE_BOOL(Z_DVAL_P(op1) - (double)Z_LVAL_P(op2)); in zend_compare()
2078 return ZEND_NORMALIZE_BOOL((double)Z_LVAL_P(op1) - Z_DVAL_P(op2)); in zend_compare()
2081 if (Z_DVAL_P(op1) == Z_DVAL_P(op2)) { in zend_compare()
2084 return ZEND_NORMALIZE_BOOL(Z_DVAL_P(op1) - Z_DVAL_P(op2)); in zend_compare()
2088 return zend_compare_arrays(op1, op2); in zend_compare()
2104 if (Z_STR_P(op1) == Z_STR_P(op2)) { in zend_compare()
2107 return zendi_smart_strcmp(Z_STR_P(op1), Z_STR_P(op2)); in zend_compare()
2113 return Z_STRLEN_P(op1) == 0 ? 0 : 1; in zend_compare()
2116 return compare_long_to_string(Z_LVAL_P(op1), Z_STR_P(op2)); in zend_compare()
2119 return -compare_long_to_string(Z_LVAL_P(op2), Z_STR_P(op1)); in zend_compare()
2122 if (zend_isnan(Z_DVAL_P(op1))) { in zend_compare()
2126 return compare_double_to_string(Z_DVAL_P(op1), Z_STR_P(op2)); in zend_compare()
2133 return -compare_double_to_string(Z_DVAL_P(op2), Z_STR_P(op1)); in zend_compare()
2142 if (Z_ISREF_P(op1)) { in zend_compare()
2143 op1 = Z_REFVAL_P(op1); in zend_compare()
2150 if (Z_TYPE_P(op1) == IS_OBJECT in zend_compare()
2152 && Z_OBJ_P(op1) == Z_OBJ_P(op2)) { in zend_compare()
2154 } else if (Z_TYPE_P(op1) == IS_OBJECT) { in zend_compare()
2155 return Z_OBJ_HANDLER_P(op1, compare)(op1, op2); in zend_compare()
2157 return Z_OBJ_HANDLER_P(op2, compare)(op1, op2); in zend_compare()
2161 if (Z_TYPE_P(op1) < IS_TRUE) { in zend_compare()
2163 } else if (Z_TYPE_P(op1) == IS_TRUE) { in zend_compare()
2166 return zval_is_true(op1) ? 1 : 0; in zend_compare()
2168 return zval_is_true(op1) ? 0 : -1; in zend_compare()
2170 op1 = _zendi_convert_scalar_to_number_silent(op1, &op1_copy); in zend_compare()
2177 } else if (Z_TYPE_P(op1)==IS_ARRAY) { in zend_compare()
2205 ZEND_API zend_bool ZEND_FASTCALL zend_is_identical(zval *op1, zval *op2) /* {{{ */ in zend_is_identical() argument
2207 if (Z_TYPE_P(op1) != Z_TYPE_P(op2)) { in zend_is_identical()
2210 switch (Z_TYPE_P(op1)) { in zend_is_identical()
2216 return (Z_LVAL_P(op1) == Z_LVAL_P(op2)); in zend_is_identical()
2218 return (Z_RES_P(op1) == Z_RES_P(op2)); in zend_is_identical()
2220 return (Z_DVAL_P(op1) == Z_DVAL_P(op2)); in zend_is_identical()
2222 return zend_string_equals(Z_STR_P(op1), Z_STR_P(op2)); in zend_is_identical()
2224 return (Z_ARRVAL_P(op1) == Z_ARRVAL_P(op2) || in zend_is_identical()
2225 …zend_hash_compare(Z_ARRVAL_P(op1), Z_ARRVAL_P(op2), (compare_func_t) hash_zval_identical_function,… in zend_is_identical()
2227 return (Z_OBJ_P(op1) == Z_OBJ_P(op2)); in zend_is_identical()
2234 ZEND_API zend_result ZEND_FASTCALL is_identical_function(zval *result, zval *op1, zval *op2) /* {{{… in is_identical_function() argument
2236 ZVAL_BOOL(result, zend_is_identical(op1, op2)); in is_identical_function()
2241 ZEND_API zend_result ZEND_FASTCALL is_not_identical_function(zval *result, zval *op1, zval *op2) /*… in is_not_identical_function() argument
2243 ZVAL_BOOL(result, !zend_is_identical(op1, op2)); in is_not_identical_function()
2248 ZEND_API zend_result ZEND_FASTCALL is_equal_function(zval *result, zval *op1, zval *op2) /* {{{ */ in is_equal_function() argument
2250 ZVAL_BOOL(result, zend_compare(op1, op2) == 0); in is_equal_function()
2255 ZEND_API zend_result ZEND_FASTCALL is_not_equal_function(zval *result, zval *op1, zval *op2) /* {{{… in is_not_equal_function() argument
2257 ZVAL_BOOL(result, (zend_compare(op1, op2) != 0)); in is_not_equal_function()
2262 ZEND_API zend_result ZEND_FASTCALL is_smaller_function(zval *result, zval *op1, zval *op2) /* {{{ */ in is_smaller_function() argument
2264 ZVAL_BOOL(result, (zend_compare(op1, op2) < 0)); in is_smaller_function()
2269 ZEND_API zend_result ZEND_FASTCALL is_smaller_or_equal_function(zval *result, zval *op1, zval *op2)… in is_smaller_or_equal_function() argument
2271 ZVAL_BOOL(result, (zend_compare(op1, op2) <= 0)); in is_smaller_or_equal_function()
2411 ZEND_API zend_result ZEND_FASTCALL increment_function(zval *op1) /* {{{ */ in increment_function() argument
2414 switch (Z_TYPE_P(op1)) { in increment_function()
2416 fast_long_increment_function(op1); in increment_function()
2419 Z_DVAL_P(op1) = Z_DVAL_P(op1) + 1; in increment_function()
2422 ZVAL_LONG(op1, 1); in increment_function()
2428 switch (is_numeric_str_function(Z_STR_P(op1), &lval, &dval)) { in increment_function()
2430 zval_ptr_dtor_str(op1); in increment_function()
2434 ZVAL_DOUBLE(op1, d+1); in increment_function()
2436 ZVAL_LONG(op1, lval+1); in increment_function()
2440 zval_ptr_dtor_str(op1); in increment_function()
2441 ZVAL_DOUBLE(op1, dval+1); in increment_function()
2445 increment_string(op1); in increment_function()
2455 op1 = Z_REFVAL_P(op1); in increment_function()
2458 if (Z_OBJ_HANDLER_P(op1, do_operation)) { in increment_function()
2461 if (Z_OBJ_HANDLER_P(op1, do_operation)(ZEND_ADD, op1, op1, &op2) == SUCCESS) { in increment_function()
2468 zend_type_error("Cannot increment %s", zend_zval_type_name(op1)); in increment_function()
2476 ZEND_API zend_result ZEND_FASTCALL decrement_function(zval *op1) /* {{{ */ in decrement_function() argument
2482 switch (Z_TYPE_P(op1)) { in decrement_function()
2484 fast_long_decrement_function(op1); in decrement_function()
2487 Z_DVAL_P(op1) = Z_DVAL_P(op1) - 1; in decrement_function()
2490 if (Z_STRLEN_P(op1) == 0) { /* consider as 0 */ in decrement_function()
2491 zval_ptr_dtor_str(op1); in decrement_function()
2492 ZVAL_LONG(op1, -1); in decrement_function()
2495 switch (is_numeric_str_function(Z_STR_P(op1), &lval, &dval)) { in decrement_function()
2497 zval_ptr_dtor_str(op1); in decrement_function()
2500 ZVAL_DOUBLE(op1, d-1); in decrement_function()
2502 ZVAL_LONG(op1, lval-1); in decrement_function()
2506 zval_ptr_dtor_str(op1); in decrement_function()
2507 ZVAL_DOUBLE(op1, dval - 1); in decrement_function()
2517 op1 = Z_REFVAL_P(op1); in decrement_function()
2520 if (Z_OBJ_HANDLER_P(op1, do_operation)) { in decrement_function()
2523 if (Z_OBJ_HANDLER_P(op1, do_operation)(ZEND_SUB, op1, op1, &op2) == SUCCESS) { in decrement_function()
2530 zend_type_error("Cannot decrement %s", zend_zval_type_name(op1)); in decrement_function()