Lines Matching refs:op2
758 ZEND_API int add_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in add_function()
764 switch (TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2))) { in add_function()
766 long lval = Z_LVAL_P(op1) + Z_LVAL_P(op2); in add_function()
769 if ((Z_LVAL_P(op1) & LONG_SIGN_MASK) == (Z_LVAL_P(op2) & LONG_SIGN_MASK) in add_function()
772 ZVAL_DOUBLE(result, (double) Z_LVAL_P(op1) + (double) Z_LVAL_P(op2)); in add_function()
780 ZVAL_DOUBLE(result, ((double)Z_LVAL_P(op1)) + Z_DVAL_P(op2)); in add_function()
784 ZVAL_DOUBLE(result, Z_DVAL_P(op1) + ((double)Z_LVAL_P(op2))); in add_function()
788 ZVAL_DOUBLE(result, Z_DVAL_P(op1) + Z_DVAL_P(op2)); in add_function()
794 if ((result == op1) && (result == op2)) { in add_function()
802 …zend_hash_merge(Z_ARRVAL_P(result), Z_ARRVAL_P(op2), (void (*)(void *pData)) zval_add_ref, (void *… in add_function()
809 zendi_convert_scalar_to_number(op2, op2_copy, result); in add_function()
820 ZEND_API int sub_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in sub_function()
826 switch (TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2))) { in sub_function()
828 long lval = Z_LVAL_P(op1) - Z_LVAL_P(op2); in sub_function()
831 if ((Z_LVAL_P(op1) & LONG_SIGN_MASK) != (Z_LVAL_P(op2) & LONG_SIGN_MASK) in sub_function()
834 ZVAL_DOUBLE(result, (double) Z_LVAL_P(op1) - (double) Z_LVAL_P(op2)); in sub_function()
842 ZVAL_DOUBLE(result, ((double)Z_LVAL_P(op1)) - Z_DVAL_P(op2)); in sub_function()
846 ZVAL_DOUBLE(result, Z_DVAL_P(op1) - ((double)Z_LVAL_P(op2))); in sub_function()
850 ZVAL_DOUBLE(result, Z_DVAL_P(op1) - Z_DVAL_P(op2)); in sub_function()
856 zendi_convert_scalar_to_number(op2, op2_copy, result); in sub_function()
867 ZEND_API int mul_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in mul_function()
873 switch (TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2))) { in mul_function()
877 …ZEND_SIGNED_MULTIPLY_LONG(Z_LVAL_P(op1),Z_LVAL_P(op2), Z_LVAL_P(result),Z_DVAL_P(result),overflow); in mul_function()
883 ZVAL_DOUBLE(result, ((double)Z_LVAL_P(op1)) * Z_DVAL_P(op2)); in mul_function()
887 ZVAL_DOUBLE(result, Z_DVAL_P(op1) * ((double)Z_LVAL_P(op2))); in mul_function()
891 ZVAL_DOUBLE(result, Z_DVAL_P(op1) * Z_DVAL_P(op2)); in mul_function()
897 zendi_convert_scalar_to_number(op2, op2_copy, result); in mul_function()
908 ZEND_API int div_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in div_function()
914 switch (TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2))) { in div_function()
916 if (Z_LVAL_P(op2) == 0) { in div_function()
920 } else if (Z_LVAL_P(op2) == -1 && Z_LVAL_P(op1) == LONG_MIN) { in div_function()
925 if (Z_LVAL_P(op1) % Z_LVAL_P(op2) == 0) { /* integer */ in div_function()
926 ZVAL_LONG(result, Z_LVAL_P(op1) / Z_LVAL_P(op2)); in div_function()
928 ZVAL_DOUBLE(result, ((double) Z_LVAL_P(op1)) / Z_LVAL_P(op2)); in div_function()
933 if (Z_LVAL_P(op2) == 0) { in div_function()
938 ZVAL_DOUBLE(result, Z_DVAL_P(op1) / (double)Z_LVAL_P(op2)); in div_function()
942 if (Z_DVAL_P(op2) == 0) { in div_function()
947 ZVAL_DOUBLE(result, (double)Z_LVAL_P(op1) / Z_DVAL_P(op2)); in div_function()
951 if (Z_DVAL_P(op2) == 0) { in div_function()
956 ZVAL_DOUBLE(result, Z_DVAL_P(op1) / Z_DVAL_P(op2)); in div_function()
962 zendi_convert_scalar_to_number(op2, op2_copy, result); in div_function()
973 ZEND_API int mod_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in mod_function()
980 zendi_convert_to_long(op2, op2_copy, result); in mod_function()
982 if (Z_LVAL_P(op2) == 0) { in mod_function()
988 if (Z_LVAL_P(op2) == -1) { in mod_function()
994 ZVAL_LONG(result, op1_lval % Z_LVAL_P(op2)); in mod_function()
999 ZEND_API int boolean_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in boolean_xor_function()
1006 zendi_convert_to_boolean(op2, op2_copy, result); in boolean_xor_function()
1007 ZVAL_BOOL(result, op1_lval ^ Z_LVAL_P(op2)); in boolean_xor_function()
1050 ZEND_API int bitwise_or_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in bitwise_or_function()
1055 if (Z_TYPE_P(op1) == IS_STRING && Z_TYPE_P(op2) == IS_STRING) { in bitwise_or_function()
1060 if (Z_STRLEN_P(op1) >= Z_STRLEN_P(op2)) { in bitwise_or_function()
1062 shorter = op2; in bitwise_or_function()
1064 longer = op2; in bitwise_or_function()
1083 zendi_convert_to_long(op2, op2_copy, result); in bitwise_or_function()
1085 ZVAL_LONG(result, op1_lval | Z_LVAL_P(op2)); in bitwise_or_function()
1090 ZEND_API int bitwise_and_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in bitwise_and_function()
1095 if (Z_TYPE_P(op1) == IS_STRING && Z_TYPE_P(op2) == IS_STRING) { in bitwise_and_function()
1100 if (Z_STRLEN_P(op1) >= Z_STRLEN_P(op2)) { in bitwise_and_function()
1102 shorter = op2; in bitwise_and_function()
1104 longer = op2; in bitwise_and_function()
1125 zendi_convert_to_long(op2, op2_copy, result); in bitwise_and_function()
1127 ZVAL_LONG(result, op1_lval & Z_LVAL_P(op2)); in bitwise_and_function()
1132 ZEND_API int bitwise_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in bitwise_xor_function()
1137 if (Z_TYPE_P(op1) == IS_STRING && Z_TYPE_P(op2) == IS_STRING) { in bitwise_xor_function()
1142 if (Z_STRLEN_P(op1) >= Z_STRLEN_P(op2)) { in bitwise_xor_function()
1144 shorter = op2; in bitwise_xor_function()
1146 longer = op2; in bitwise_xor_function()
1166 zendi_convert_to_long(op2, op2_copy, result); in bitwise_xor_function()
1168 ZVAL_LONG(result, op1_lval ^ Z_LVAL_P(op2)); in bitwise_xor_function()
1173 ZEND_API int shift_left_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in shift_left_function()
1180 zendi_convert_to_long(op2, op2_copy, result); in shift_left_function()
1181 ZVAL_LONG(result, op1_lval << Z_LVAL_P(op2)); in shift_left_function()
1186 ZEND_API int shift_right_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in shift_right_function()
1193 zendi_convert_to_long(op2, op2_copy, result); in shift_right_function()
1194 ZVAL_LONG(result, op1_lval >> Z_LVAL_P(op2)); in shift_right_function()
1200 ZEND_API int add_char_to_string(zval *result, const zval *op1, const zval *op2) /* {{{ */ in add_char_to_string() argument
1204 Z_STRVAL_P(result)[Z_STRLEN_P(result) - 1] = (char) Z_LVAL_P(op2); in add_char_to_string()
1212 ZEND_API int add_string_to_string(zval *result, const zval *op1, const zval *op2) /* {{{ */ in add_string_to_string() argument
1214 int length = Z_STRLEN_P(op1) + Z_STRLEN_P(op2); in add_string_to_string()
1217 memcpy(Z_STRVAL_P(result)+Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2)); in add_string_to_string()
1225 ZEND_API int concat_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in concat_function()
1233 if (Z_TYPE_P(op2) != IS_STRING) { in concat_function()
1234 zend_make_printable_zval(op2, &op2_copy, &use_copy2); in concat_function()
1247 op2 = &op2_copy; in concat_function()
1250 uint res_len = Z_STRLEN_P(op1) + Z_STRLEN_P(op2); in concat_function()
1252 if (Z_STRLEN_P(result) < 0 || (int) (Z_STRLEN_P(op1) + Z_STRLEN_P(op2)) < 0) { in concat_function()
1260 memcpy(Z_STRVAL_P(result)+Z_STRLEN_P(result), Z_STRVAL_P(op2), Z_STRLEN_P(op2)); in concat_function()
1264 Z_STRLEN_P(result) = Z_STRLEN_P(op1) + Z_STRLEN_P(op2); in concat_function()
1267 memcpy(Z_STRVAL_P(result)+Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2)); in concat_function()
1275 zval_dtor(op2); in concat_function()
1281 ZEND_API int string_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in string_compare_function()
1289 if (Z_TYPE_P(op2) != IS_STRING) { in string_compare_function()
1290 zend_make_printable_zval(op2, &op2_copy, &use_copy2); in string_compare_function()
1297 op2 = &op2_copy; in string_compare_function()
1300 ZVAL_LONG(result, zend_binary_zval_strcmp(op1, op2)); in string_compare_function()
1306 zval_dtor(op2); in string_compare_function()
1313 ZEND_API int string_locale_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in string_locale_compare_function()
1321 if (Z_TYPE_P(op2) != IS_STRING) { in string_locale_compare_function()
1322 zend_make_printable_zval(op2, &op2_copy, &use_copy2); in string_locale_compare_function()
1329 op2 = &op2_copy; in string_locale_compare_function()
1332 ZVAL_LONG(result, strcoll(Z_STRVAL_P(op1), Z_STRVAL_P(op2))); in string_locale_compare_function()
1338 zval_dtor(op2); in string_locale_compare_function()
1345 ZEND_API int numeric_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in numeric_compare_function()
1352 op2_copy = *op2; in numeric_compare_function()
1376 ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in compare_function()
1384 switch (TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2))) { in compare_function()
1386 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()
1390 Z_DVAL_P(result) = Z_DVAL_P(op1) - (double)Z_LVAL_P(op2); in compare_function()
1395 Z_DVAL_P(result) = (double)Z_LVAL_P(op1) - Z_DVAL_P(op2); in compare_function()
1400 Z_DVAL_P(result) = Z_DVAL_P(op1) - Z_DVAL_P(op2); in compare_function()
1405 zend_compare_arrays(result, op1, op2 TSRMLS_CC); in compare_function()
1413 ZVAL_LONG(result, Z_LVAL_P(op2) ? -1 : 0); in compare_function()
1421 ZVAL_LONG(result, ZEND_NORMALIZE_BOOL(Z_LVAL_P(op1) - Z_LVAL_P(op2))); in compare_function()
1425 zendi_smart_strcmp(result, op1, op2); in compare_function()
1429 ZVAL_LONG(result, zend_binary_strcmp("", 0, Z_STRVAL_P(op2), Z_STRLEN_P(op2))); in compare_function()
1446 if (Z_OBJ_HANDLER_P(op1,compare_objects) == Z_OBJ_HANDLER_P(op2,compare_objects)) { in compare_function()
1447 if (Z_OBJ_HANDLE_P(op1) == Z_OBJ_HANDLE_P(op2)) { in compare_function()
1452 ZVAL_LONG(result, Z_OBJ_HT_P(op1)->compare_objects(op1, op2 TSRMLS_CC)); in compare_function()
1461 ret = compare_function(result, op_free, op2 TSRMLS_CC); in compare_function()
1464 } else if (Z_TYPE_P(op2) != IS_OBJECT && Z_OBJ_HT_P(op1)->cast_object) { in compare_function()
1466 if (Z_OBJ_HT_P(op1)->cast_object(op1, op_free, Z_TYPE_P(op2) TSRMLS_CC) == FAILURE) { in compare_function()
1471 ret = compare_function(result, op_free, op2 TSRMLS_CC); in compare_function()
1476 if (Z_TYPE_P(op2) == IS_OBJECT) { in compare_function()
1477 if (Z_OBJ_HT_P(op2)->get) { in compare_function()
1478 op_free = Z_OBJ_HT_P(op2)->get(op2 TSRMLS_CC); in compare_function()
1482 } else if (Z_TYPE_P(op1) != IS_OBJECT && Z_OBJ_HT_P(op2)->cast_object) { in compare_function()
1484 if (Z_OBJ_HT_P(op2)->cast_object(op2, op_free, Z_TYPE_P(op1) TSRMLS_CC) == FAILURE) { in compare_function()
1499 zendi_convert_to_boolean(op2, op2_copy, result); in compare_function()
1500 ZVAL_LONG(result, Z_LVAL_P(op2) ? -1 : 0); in compare_function()
1502 } else if (Z_TYPE_P(op2) == IS_NULL) { in compare_function()
1507 zendi_convert_to_boolean(op2, op2_copy, result); in compare_function()
1508 ZVAL_LONG(result, ZEND_NORMALIZE_BOOL(Z_LVAL_P(op1) - Z_LVAL_P(op2))); in compare_function()
1510 } else if (Z_TYPE_P(op2) == IS_BOOL) { in compare_function()
1512 ZVAL_LONG(result, ZEND_NORMALIZE_BOOL(Z_LVAL_P(op1) - Z_LVAL_P(op2))); in compare_function()
1516 zendi_convert_scalar_to_number(op2, op2_copy, result); in compare_function()
1522 } else if (Z_TYPE_P(op2)==IS_ARRAY) { in compare_function()
1528 } else if (Z_TYPE_P(op2)==IS_OBJECT) { in compare_function()
1557 ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in is_identical_function()
1560 if (Z_TYPE_P(op1) != Z_TYPE_P(op2)) { in is_identical_function()
1571 Z_LVAL_P(result) = (Z_LVAL_P(op1) == Z_LVAL_P(op2)); in is_identical_function()
1574 Z_LVAL_P(result) = (Z_DVAL_P(op1) == Z_DVAL_P(op2)); in is_identical_function()
1577 Z_LVAL_P(result) = ((Z_STRLEN_P(op1) == Z_STRLEN_P(op2)) in is_identical_function()
1578 && (!memcmp(Z_STRVAL_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op1)))); in is_identical_function()
1581 Z_LVAL_P(result) = (Z_ARRVAL_P(op1) == Z_ARRVAL_P(op2) || in is_identical_function()
1582 …zend_hash_compare(Z_ARRVAL_P(op1), Z_ARRVAL_P(op2), (compare_func_t) hash_zval_identical_function,… in is_identical_function()
1585 if (Z_OBJ_HT_P(op1) == Z_OBJ_HT_P(op2)) { in is_identical_function()
1586 Z_LVAL_P(result) = (Z_OBJ_HANDLE_P(op1) == Z_OBJ_HANDLE_P(op2)); in is_identical_function()
1599 ZEND_API int is_not_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in is_not_identical_function()
1601 if (is_identical_function(result, op1, op2 TSRMLS_CC) == FAILURE) { in is_not_identical_function()
1609 ZEND_API int is_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in is_equal_function()
1611 if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) { in is_equal_function()
1619 ZEND_API int is_not_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in is_not_equal_function()
1621 if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) { in is_not_equal_function()
1629 ZEND_API int is_smaller_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in is_smaller_function()
1631 if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) { in is_smaller_function()
1639 ZEND_API int is_smaller_or_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in is_smaller_or_equal_function()
1641 if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) { in is_smaller_or_equal_function()