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()
861 zendi_convert_scalar_to_number(op2, op2_copy, result); in add_function()
872 ZEND_API int sub_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in sub_function()
878 switch (TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2))) { in sub_function()
880 long lval = Z_LVAL_P(op1) - Z_LVAL_P(op2); in sub_function()
883 if ((Z_LVAL_P(op1) & LONG_SIGN_MASK) != (Z_LVAL_P(op2) & LONG_SIGN_MASK) in sub_function()
886 ZVAL_DOUBLE(result, (double) Z_LVAL_P(op1) - (double) Z_LVAL_P(op2)); in sub_function()
894 ZVAL_DOUBLE(result, ((double)Z_LVAL_P(op1)) - Z_DVAL_P(op2)); in sub_function()
898 ZVAL_DOUBLE(result, Z_DVAL_P(op1) - ((double)Z_LVAL_P(op2))); in sub_function()
902 ZVAL_DOUBLE(result, Z_DVAL_P(op1) - Z_DVAL_P(op2)); in sub_function()
908 zendi_convert_scalar_to_number(op2, op2_copy, result); in sub_function()
919 ZEND_API int mul_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in mul_function()
925 switch (TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2))) { in mul_function()
929 …ZEND_SIGNED_MULTIPLY_LONG(Z_LVAL_P(op1),Z_LVAL_P(op2), Z_LVAL_P(result),Z_DVAL_P(result),overflow); in mul_function()
935 ZVAL_DOUBLE(result, ((double)Z_LVAL_P(op1)) * Z_DVAL_P(op2)); in mul_function()
939 ZVAL_DOUBLE(result, Z_DVAL_P(op1) * ((double)Z_LVAL_P(op2))); in mul_function()
943 ZVAL_DOUBLE(result, Z_DVAL_P(op1) * Z_DVAL_P(op2)); in mul_function()
949 zendi_convert_scalar_to_number(op2, op2_copy, result); in mul_function()
960 ZEND_API int div_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in div_function()
966 switch (TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2))) { in div_function()
968 if (Z_LVAL_P(op2) == 0) { in div_function()
972 } else if (Z_LVAL_P(op2) == -1 && Z_LVAL_P(op1) == LONG_MIN) { in div_function()
977 if (Z_LVAL_P(op1) % Z_LVAL_P(op2) == 0) { /* integer */ in div_function()
978 ZVAL_LONG(result, Z_LVAL_P(op1) / Z_LVAL_P(op2)); in div_function()
980 ZVAL_DOUBLE(result, ((double) Z_LVAL_P(op1)) / Z_LVAL_P(op2)); in div_function()
985 if (Z_LVAL_P(op2) == 0) { in div_function()
990 ZVAL_DOUBLE(result, Z_DVAL_P(op1) / (double)Z_LVAL_P(op2)); in div_function()
994 if (Z_DVAL_P(op2) == 0) { in div_function()
999 ZVAL_DOUBLE(result, (double)Z_LVAL_P(op1) / Z_DVAL_P(op2)); in div_function()
1003 if (Z_DVAL_P(op2) == 0) { in div_function()
1008 ZVAL_DOUBLE(result, Z_DVAL_P(op1) / Z_DVAL_P(op2)); in div_function()
1014 zendi_convert_scalar_to_number(op2, op2_copy, result); in div_function()
1025 ZEND_API int mod_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in mod_function()
1032 zendi_convert_to_long(op2, op2_copy, result); in mod_function()
1034 if (Z_LVAL_P(op2) == 0) { in mod_function()
1040 if (Z_LVAL_P(op2) == -1) { in mod_function()
1046 ZVAL_LONG(result, op1_lval % Z_LVAL_P(op2)); in mod_function()
1051 ZEND_API int boolean_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in boolean_xor_function()
1058 zendi_convert_to_boolean(op2, op2_copy, result); in boolean_xor_function()
1059 ZVAL_BOOL(result, op1_lval ^ Z_LVAL_P(op2)); in boolean_xor_function()
1102 ZEND_API int bitwise_or_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in bitwise_or_function()
1107 if (Z_TYPE_P(op1) == IS_STRING && Z_TYPE_P(op2) == IS_STRING) { in bitwise_or_function()
1112 if (Z_STRLEN_P(op1) >= Z_STRLEN_P(op2)) { in bitwise_or_function()
1114 shorter = op2; in bitwise_or_function()
1116 longer = op2; in bitwise_or_function()
1135 zendi_convert_to_long(op2, op2_copy, result); in bitwise_or_function()
1137 ZVAL_LONG(result, op1_lval | Z_LVAL_P(op2)); in bitwise_or_function()
1142 ZEND_API int bitwise_and_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in bitwise_and_function()
1147 if (Z_TYPE_P(op1) == IS_STRING && Z_TYPE_P(op2) == IS_STRING) { in bitwise_and_function()
1152 if (Z_STRLEN_P(op1) >= Z_STRLEN_P(op2)) { in bitwise_and_function()
1154 shorter = op2; in bitwise_and_function()
1156 longer = op2; in bitwise_and_function()
1177 zendi_convert_to_long(op2, op2_copy, result); in bitwise_and_function()
1179 ZVAL_LONG(result, op1_lval & Z_LVAL_P(op2)); in bitwise_and_function()
1184 ZEND_API int bitwise_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in bitwise_xor_function()
1189 if (Z_TYPE_P(op1) == IS_STRING && Z_TYPE_P(op2) == IS_STRING) { in bitwise_xor_function()
1194 if (Z_STRLEN_P(op1) >= Z_STRLEN_P(op2)) { in bitwise_xor_function()
1196 shorter = op2; in bitwise_xor_function()
1198 longer = op2; in bitwise_xor_function()
1218 zendi_convert_to_long(op2, op2_copy, result); in bitwise_xor_function()
1220 ZVAL_LONG(result, op1_lval ^ Z_LVAL_P(op2)); in bitwise_xor_function()
1225 ZEND_API int shift_left_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in shift_left_function()
1232 zendi_convert_to_long(op2, op2_copy, result); in shift_left_function()
1233 ZVAL_LONG(result, op1_lval << Z_LVAL_P(op2)); in shift_left_function()
1238 ZEND_API int shift_right_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in shift_right_function()
1245 zendi_convert_to_long(op2, op2_copy, result); in shift_right_function()
1246 ZVAL_LONG(result, op1_lval >> Z_LVAL_P(op2)); in shift_right_function()
1252 ZEND_API int add_char_to_string(zval *result, const zval *op1, const zval *op2) /* {{{ */ in add_char_to_string() argument
1267 buf[length - 1] = (char) Z_LVAL_P(op2); in add_char_to_string()
1275 ZEND_API int add_string_to_string(zval *result, const zval *op1, const zval *op2) /* {{{ */ in add_string_to_string() argument
1277 int length = Z_STRLEN_P(op1) + Z_STRLEN_P(op2); in add_string_to_string()
1289 memcpy(buf + Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2)); in add_string_to_string()
1296 ZEND_API int concat_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in concat_function()
1304 if (Z_TYPE_P(op2) != IS_STRING) { in concat_function()
1305 zend_make_printable_zval(op2, &op2_copy, &use_copy2); in concat_function()
1318 op2 = &op2_copy; in concat_function()
1321 uint res_len = Z_STRLEN_P(op1) + Z_STRLEN_P(op2); in concat_function()
1323 if (Z_STRLEN_P(result) < 0 || (int) (Z_STRLEN_P(op1) + Z_STRLEN_P(op2)) < 0) { in concat_function()
1331 memcpy(Z_STRVAL_P(result)+Z_STRLEN_P(result), Z_STRVAL_P(op2), Z_STRLEN_P(op2)); in concat_function()
1335 int length = Z_STRLEN_P(op1) + Z_STRLEN_P(op2); in concat_function()
1338 if (Z_STRLEN_P(op1) < 0 || Z_STRLEN_P(op2) < 0 || (int) (Z_STRLEN_P(op1) + Z_STRLEN_P(op2)) < 0) { in concat_function()
1344 memcpy(buf + Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2)); in concat_function()
1352 zval_dtor(op2); in concat_function()
1358 ZEND_API int string_compare_function_ex(zval *result, zval *op1, zval *op2, zend_bool case_insensit… in string_compare_function_ex() argument
1366 if (Z_TYPE_P(op2) != IS_STRING) { in string_compare_function_ex()
1367 zend_make_printable_zval(op2, &op2_copy, &use_copy2); in string_compare_function_ex()
1374 op2 = &op2_copy; in string_compare_function_ex()
1378 ZVAL_LONG(result, zend_binary_zval_strcasecmp(op1, op2)); in string_compare_function_ex()
1380 ZVAL_LONG(result, zend_binary_zval_strcmp(op1, op2)); in string_compare_function_ex()
1387 zval_dtor(op2); in string_compare_function_ex()
1393 ZEND_API int string_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in string_compare_function()
1395 return string_compare_function_ex(result, op1, op2, 0 TSRMLS_CC); in string_compare_function()
1399 ZEND_API int string_case_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in string_case_compare_function()
1401 return string_compare_function_ex(result, op1, op2, 1 TSRMLS_CC); in string_case_compare_function()
1406 ZEND_API int string_locale_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in string_locale_compare_function()
1414 if (Z_TYPE_P(op2) != IS_STRING) { in string_locale_compare_function()
1415 zend_make_printable_zval(op2, &op2_copy, &use_copy2); in string_locale_compare_function()
1422 op2 = &op2_copy; in string_locale_compare_function()
1425 ZVAL_LONG(result, strcoll(Z_STRVAL_P(op1), Z_STRVAL_P(op2))); in string_locale_compare_function()
1431 zval_dtor(op2); in string_locale_compare_function()
1438 ZEND_API int numeric_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in numeric_compare_function()
1445 op2_copy = *op2; in numeric_compare_function()
1469 ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in compare_function()
1477 switch (TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2))) { in compare_function()
1479 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()
1483 Z_DVAL_P(result) = Z_DVAL_P(op1) - (double)Z_LVAL_P(op2); in compare_function()
1488 Z_DVAL_P(result) = (double)Z_LVAL_P(op1) - Z_DVAL_P(op2); in compare_function()
1493 if (Z_DVAL_P(op1) == Z_DVAL_P(op2)) { in compare_function()
1496 Z_DVAL_P(result) = Z_DVAL_P(op1) - Z_DVAL_P(op2); in compare_function()
1502 zend_compare_arrays(result, op1, op2 TSRMLS_CC); in compare_function()
1510 ZVAL_LONG(result, Z_LVAL_P(op2) ? -1 : 0); in compare_function()
1518 ZVAL_LONG(result, ZEND_NORMALIZE_BOOL(Z_LVAL_P(op1) - Z_LVAL_P(op2))); in compare_function()
1522 zendi_smart_strcmp(result, op1, op2); in compare_function()
1526 ZVAL_LONG(result, zend_binary_strcmp("", 0, Z_STRVAL_P(op2), Z_STRLEN_P(op2))); in compare_function()
1543 if (Z_OBJ_HANDLER_P(op1,compare_objects) == Z_OBJ_HANDLER_P(op2,compare_objects)) { in compare_function()
1544 if (Z_OBJ_HANDLE_P(op1) == Z_OBJ_HANDLE_P(op2)) { in compare_function()
1549 ZVAL_LONG(result, Z_OBJ_HT_P(op1)->compare_objects(op1, op2 TSRMLS_CC)); in compare_function()
1558 ret = compare_function(result, op_free, op2 TSRMLS_CC); in compare_function()
1561 } else if (Z_TYPE_P(op2) != IS_OBJECT && Z_OBJ_HT_P(op1)->cast_object) { in compare_function()
1563 if (Z_OBJ_HT_P(op1)->cast_object(op1, op_free, Z_TYPE_P(op2) TSRMLS_CC) == FAILURE) { in compare_function()
1568 ret = compare_function(result, op_free, op2 TSRMLS_CC); in compare_function()
1573 if (Z_TYPE_P(op2) == IS_OBJECT) { in compare_function()
1574 if (Z_OBJ_HT_P(op2)->get) { in compare_function()
1575 op_free = Z_OBJ_HT_P(op2)->get(op2 TSRMLS_CC); in compare_function()
1579 } else if (Z_TYPE_P(op1) != IS_OBJECT && Z_OBJ_HT_P(op2)->cast_object) { in compare_function()
1581 if (Z_OBJ_HT_P(op2)->cast_object(op2, op_free, Z_TYPE_P(op1) TSRMLS_CC) == FAILURE) { in compare_function()
1596 zendi_convert_to_boolean(op2, op2_copy, result); in compare_function()
1597 ZVAL_LONG(result, Z_LVAL_P(op2) ? -1 : 0); in compare_function()
1599 } else if (Z_TYPE_P(op2) == IS_NULL) { in compare_function()
1604 zendi_convert_to_boolean(op2, op2_copy, result); in compare_function()
1605 ZVAL_LONG(result, ZEND_NORMALIZE_BOOL(Z_LVAL_P(op1) - Z_LVAL_P(op2))); in compare_function()
1607 } else if (Z_TYPE_P(op2) == IS_BOOL) { in compare_function()
1609 ZVAL_LONG(result, ZEND_NORMALIZE_BOOL(Z_LVAL_P(op1) - Z_LVAL_P(op2))); in compare_function()
1613 zendi_convert_scalar_to_number(op2, op2_copy, result); in compare_function()
1619 } else if (Z_TYPE_P(op2)==IS_ARRAY) { in compare_function()
1625 } else if (Z_TYPE_P(op2)==IS_OBJECT) { in compare_function()
1654 ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in is_identical_function()
1657 if (Z_TYPE_P(op1) != Z_TYPE_P(op2)) { in is_identical_function()
1668 Z_LVAL_P(result) = (Z_LVAL_P(op1) == Z_LVAL_P(op2)); in is_identical_function()
1671 Z_LVAL_P(result) = (Z_DVAL_P(op1) == Z_DVAL_P(op2)); in is_identical_function()
1674 Z_LVAL_P(result) = ((Z_STRLEN_P(op1) == Z_STRLEN_P(op2)) in is_identical_function()
1675 && (!memcmp(Z_STRVAL_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op1)))); in is_identical_function()
1678 Z_LVAL_P(result) = (Z_ARRVAL_P(op1) == Z_ARRVAL_P(op2) || in is_identical_function()
1679 …zend_hash_compare(Z_ARRVAL_P(op1), Z_ARRVAL_P(op2), (compare_func_t) hash_zval_identical_function,… in is_identical_function()
1682 if (Z_OBJ_HT_P(op1) == Z_OBJ_HT_P(op2)) { in is_identical_function()
1683 Z_LVAL_P(result) = (Z_OBJ_HANDLE_P(op1) == Z_OBJ_HANDLE_P(op2)); in is_identical_function()
1696 ZEND_API int is_not_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in is_not_identical_function()
1698 if (is_identical_function(result, op1, op2 TSRMLS_CC) == FAILURE) { in is_not_identical_function()
1706 ZEND_API int is_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in is_equal_function()
1708 if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) { in is_equal_function()
1716 ZEND_API int is_not_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in is_not_equal_function()
1718 if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) { in is_not_equal_function()
1726 ZEND_API int is_smaller_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in is_smaller_function()
1728 if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) { in is_smaller_function()
1736 ZEND_API int is_smaller_or_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in is_smaller_or_equal_function()
1738 if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) { in is_smaller_or_equal_function()