Lines Matching refs:result
104 double result = 0.0; in zend_string_to_double() local
110 return result; in zend_string_to_double()
115 result *= 10; in zend_string_to_double()
116 result += *digit - '0'; in zend_string_to_double()
122 result *= pow(10.0, exponent); in zend_string_to_double()
123 return result; in zend_string_to_double()
125 return result; in zend_string_to_double()
132 result += (*digit - '0') / divisor; in zend_string_to_double()
136 result *= pow(10.0, exponent); in zend_string_to_double()
137 return result; in zend_string_to_double()
139 return result; in zend_string_to_double()
143 return result; in zend_string_to_double()
179 #define zendi_convert_scalar_to_number(op, holder, result) \ argument
180 if (op==result) { \
217 #define zendi_convert_to_long(op, holder, result) \ argument
218 if (op == result) { \
255 #define zendi_convert_to_boolean(op, holder, result) \ argument
256 if (op==result) { \
755 ZEND_API int add_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in add_function() argument
769 ZVAL_DOUBLE(result, (double) Z_LVAL_P(op1) + (double) Z_LVAL_P(op2)); in add_function()
771 ZVAL_LONG(result, lval); in add_function()
777 ZVAL_DOUBLE(result, ((double)Z_LVAL_P(op1)) + Z_DVAL_P(op2)); in add_function()
781 ZVAL_DOUBLE(result, Z_DVAL_P(op1) + ((double)Z_LVAL_P(op2))); in add_function()
785 ZVAL_DOUBLE(result, Z_DVAL_P(op1) + Z_DVAL_P(op2)); in add_function()
791 if ((result == op1) && (result == op2)) { in add_function()
795 if (result != op1) { in add_function()
796 *result = *op1; in add_function()
797 zval_copy_ctor(result); in add_function()
799 …zend_hash_merge(Z_ARRVAL_P(result), Z_ARRVAL_P(op2), (void (*)(void *pData)) zval_add_ref, (void *… in add_function()
805 zendi_convert_scalar_to_number(op1, op1_copy, result); in add_function()
806 zendi_convert_scalar_to_number(op2, op2_copy, result); in add_function()
817 ZEND_API int sub_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in sub_function() argument
831 ZVAL_DOUBLE(result, (double) Z_LVAL_P(op1) - (double) Z_LVAL_P(op2)); in sub_function()
833 ZVAL_LONG(result, lval); in sub_function()
839 ZVAL_DOUBLE(result, ((double)Z_LVAL_P(op1)) - Z_DVAL_P(op2)); in sub_function()
843 ZVAL_DOUBLE(result, Z_DVAL_P(op1) - ((double)Z_LVAL_P(op2))); in sub_function()
847 ZVAL_DOUBLE(result, Z_DVAL_P(op1) - Z_DVAL_P(op2)); in sub_function()
852 zendi_convert_scalar_to_number(op1, op1_copy, result); in sub_function()
853 zendi_convert_scalar_to_number(op2, op2_copy, result); in sub_function()
864 ZEND_API int mul_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in mul_function() argument
874 …ZEND_SIGNED_MULTIPLY_LONG(Z_LVAL_P(op1),Z_LVAL_P(op2), Z_LVAL_P(result),Z_DVAL_P(result),overflow); in mul_function()
875 Z_TYPE_P(result) = overflow ? IS_DOUBLE : IS_LONG; in mul_function()
880 ZVAL_DOUBLE(result, ((double)Z_LVAL_P(op1)) * Z_DVAL_P(op2)); in mul_function()
884 ZVAL_DOUBLE(result, Z_DVAL_P(op1) * ((double)Z_LVAL_P(op2))); in mul_function()
888 ZVAL_DOUBLE(result, Z_DVAL_P(op1) * Z_DVAL_P(op2)); in mul_function()
893 zendi_convert_scalar_to_number(op1, op1_copy, result); in mul_function()
894 zendi_convert_scalar_to_number(op2, op2_copy, result); in mul_function()
905 ZEND_API int div_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in div_function() argument
915 ZVAL_BOOL(result, 0); in div_function()
919 ZVAL_DOUBLE(result, (double) LONG_MIN / -1); in div_function()
923 ZVAL_LONG(result, Z_LVAL_P(op1) / Z_LVAL_P(op2)); in div_function()
925 ZVAL_DOUBLE(result, ((double) Z_LVAL_P(op1)) / Z_LVAL_P(op2)); in div_function()
932 ZVAL_BOOL(result, 0); in div_function()
935 ZVAL_DOUBLE(result, Z_DVAL_P(op1) / (double)Z_LVAL_P(op2)); in div_function()
941 ZVAL_BOOL(result, 0); in div_function()
944 ZVAL_DOUBLE(result, (double)Z_LVAL_P(op1) / Z_DVAL_P(op2)); in div_function()
950 ZVAL_BOOL(result, 0); in div_function()
953 ZVAL_DOUBLE(result, Z_DVAL_P(op1) / Z_DVAL_P(op2)); in div_function()
958 zendi_convert_scalar_to_number(op1, op1_copy, result); in div_function()
959 zendi_convert_scalar_to_number(op2, op2_copy, result); in div_function()
970 ZEND_API int mod_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in mod_function() argument
975 zendi_convert_to_long(op1, op1_copy, result); in mod_function()
977 zendi_convert_to_long(op2, op2_copy, result); in mod_function()
981 ZVAL_BOOL(result, 0); in mod_function()
987 ZVAL_LONG(result, 0); in mod_function()
991 ZVAL_LONG(result, op1_lval % Z_LVAL_P(op2)); in mod_function()
996 ZEND_API int boolean_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in boolean_xor_function() argument
1001 zendi_convert_to_boolean(op1, op1_copy, result); in boolean_xor_function()
1003 zendi_convert_to_boolean(op2, op2_copy, result); in boolean_xor_function()
1004 ZVAL_BOOL(result, op1_lval ^ Z_LVAL_P(op2)); in boolean_xor_function()
1009 ZEND_API int boolean_not_function(zval *result, zval *op1 TSRMLS_DC) /* {{{ */ in boolean_not_function() argument
1013 zendi_convert_to_boolean(op1, op1_copy, result); in boolean_not_function()
1014 ZVAL_BOOL(result, !Z_LVAL_P(op1)); in boolean_not_function()
1019 ZEND_API int bitwise_not_function(zval *result, zval *op1 TSRMLS_DC) /* {{{ */ in bitwise_not_function() argument
1026 ZVAL_LONG(result, ~Z_LVAL_P(op1)); in bitwise_not_function()
1029 ZVAL_LONG(result, ~zend_dval_to_lval(Z_DVAL_P(op1))); in bitwise_not_function()
1034 Z_TYPE_P(result) = IS_STRING; in bitwise_not_function()
1035 Z_STRVAL_P(result) = estrndup(Z_STRVAL_P(op1), Z_STRLEN_P(op1)); in bitwise_not_function()
1036 Z_STRLEN_P(result) = Z_STRLEN_P(op1); in bitwise_not_function()
1038 Z_STRVAL_P(result)[i] = ~Z_STRVAL_P(op1)[i]; in bitwise_not_function() local
1047 ZEND_API int bitwise_or_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in bitwise_or_function() argument
1065 Z_TYPE_P(result) = IS_STRING; in bitwise_or_function()
1071 if (result==op1) { in bitwise_or_function()
1072 STR_FREE(Z_STRVAL_P(result)); in bitwise_or_function()
1074 Z_STRVAL_P(result) = result_str; in bitwise_or_function()
1075 Z_STRLEN_P(result) = result_len; in bitwise_or_function()
1078 zendi_convert_to_long(op1, op1_copy, result); in bitwise_or_function()
1080 zendi_convert_to_long(op2, op2_copy, result); in bitwise_or_function()
1082 ZVAL_LONG(result, op1_lval | Z_LVAL_P(op2)); in bitwise_or_function()
1087 ZEND_API int bitwise_and_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in bitwise_and_function() argument
1105 Z_TYPE_P(result) = IS_STRING; in bitwise_and_function()
1111 if (result==op1) { in bitwise_and_function()
1112 STR_FREE(Z_STRVAL_P(result)); in bitwise_and_function()
1114 Z_STRVAL_P(result) = result_str; in bitwise_and_function()
1115 Z_STRLEN_P(result) = result_len; in bitwise_and_function()
1120 zendi_convert_to_long(op1, op1_copy, result); in bitwise_and_function()
1122 zendi_convert_to_long(op2, op2_copy, result); in bitwise_and_function()
1124 ZVAL_LONG(result, op1_lval & Z_LVAL_P(op2)); in bitwise_and_function()
1129 ZEND_API int bitwise_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in bitwise_xor_function() argument
1147 Z_TYPE_P(result) = IS_STRING; in bitwise_xor_function()
1153 if (result==op1) { in bitwise_xor_function()
1154 STR_FREE(Z_STRVAL_P(result)); in bitwise_xor_function()
1156 Z_STRVAL_P(result) = result_str; in bitwise_xor_function()
1157 Z_STRLEN_P(result) = result_len; in bitwise_xor_function()
1161 zendi_convert_to_long(op1, op1_copy, result); in bitwise_xor_function()
1163 zendi_convert_to_long(op2, op2_copy, result); in bitwise_xor_function()
1165 ZVAL_LONG(result, op1_lval ^ Z_LVAL_P(op2)); in bitwise_xor_function()
1170 ZEND_API int shift_left_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in shift_left_function() argument
1175 zendi_convert_to_long(op1, op1_copy, result); in shift_left_function()
1177 zendi_convert_to_long(op2, op2_copy, result); in shift_left_function()
1178 ZVAL_LONG(result, op1_lval << Z_LVAL_P(op2)); in shift_left_function()
1183 ZEND_API int shift_right_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in shift_right_function() argument
1188 zendi_convert_to_long(op1, op1_copy, result); in shift_right_function()
1190 zendi_convert_to_long(op2, op2_copy, result); in shift_right_function()
1191 ZVAL_LONG(result, op1_lval >> Z_LVAL_P(op2)); in shift_right_function()
1197 ZEND_API int add_char_to_string(zval *result, const zval *op1, const zval *op2) /* {{{ */ in add_char_to_string() argument
1210 ZVAL_STRINGL(result, buf, length, 0); in add_char_to_string()
1216 ZEND_API int add_string_to_string(zval *result, const zval *op1, const zval *op2) /* {{{ */ in add_string_to_string() argument
1229 ZVAL_STRINGL(result, buf, length, 0); in add_string_to_string()
1234 ZEND_API int concat_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in concat_function() argument
1250 if (result == op1) { in concat_function()
1258 …if (result==op1 && !IS_INTERNED(Z_STRVAL_P(op1))) { /* special case, perform operations on result … in concat_function()
1261 if (Z_STRLEN_P(result) < 0 || (int) (Z_STRLEN_P(op1) + Z_STRLEN_P(op2)) < 0) { in concat_function()
1262 efree(Z_STRVAL_P(result)); in concat_function()
1263 ZVAL_EMPTY_STRING(result); in concat_function()
1267 Z_STRVAL_P(result) = safe_erealloc(Z_STRVAL_P(result), res_len, 1, 1); in concat_function()
1269 memcpy(Z_STRVAL_P(result)+Z_STRLEN_P(result), Z_STRVAL_P(op2), Z_STRLEN_P(op2)); in concat_function()
1270 Z_STRVAL_P(result)[res_len]=0; in concat_function() local
1271 Z_STRLEN_P(result) = res_len; in concat_function()
1284 ZVAL_STRINGL(result, buf, length, 0); in concat_function()
1296 ZEND_API int string_compare_function_ex(zval *result, zval *op1, zval *op2, zend_bool case_insensit… in string_compare_function_ex() argument
1316 ZVAL_LONG(result, zend_binary_zval_strcasecmp(op1, op2)); in string_compare_function_ex()
1318 ZVAL_LONG(result, zend_binary_zval_strcmp(op1, op2)); in string_compare_function_ex()
1331 ZEND_API int string_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in string_compare_function() argument
1333 return string_compare_function_ex(result, op1, op2, 0 TSRMLS_CC); in string_compare_function()
1337 ZEND_API int string_case_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in string_case_compare_function() argument
1339 return string_compare_function_ex(result, op1, op2, 1 TSRMLS_CC); in string_case_compare_function()
1344 ZEND_API int string_locale_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in string_locale_compare_function() argument
1363 ZVAL_LONG(result, strcoll(Z_STRVAL_P(op1), Z_STRVAL_P(op2))); in string_locale_compare_function()
1376 ZEND_API int numeric_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in numeric_compare_function() argument
1389 ZVAL_LONG(result, ZEND_NORMALIZE_BOOL(Z_DVAL(op1_copy)-Z_DVAL(op2_copy))); in numeric_compare_function()
1407 ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in compare_function() argument
1417 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()
1421 Z_DVAL_P(result) = Z_DVAL_P(op1) - (double)Z_LVAL_P(op2); in compare_function()
1422 ZVAL_LONG(result, ZEND_NORMALIZE_BOOL(Z_DVAL_P(result))); in compare_function()
1426 Z_DVAL_P(result) = (double)Z_LVAL_P(op1) - Z_DVAL_P(op2); in compare_function()
1427 ZVAL_LONG(result, ZEND_NORMALIZE_BOOL(Z_DVAL_P(result))); in compare_function()
1432 ZVAL_LONG(result, 0); in compare_function()
1434 Z_DVAL_P(result) = Z_DVAL_P(op1) - Z_DVAL_P(op2); in compare_function()
1435 ZVAL_LONG(result, ZEND_NORMALIZE_BOOL(Z_DVAL_P(result))); in compare_function()
1440 zend_compare_arrays(result, op1, op2 TSRMLS_CC); in compare_function()
1444 ZVAL_LONG(result, 0); in compare_function()
1448 ZVAL_LONG(result, Z_LVAL_P(op2) ? -1 : 0); in compare_function()
1452 ZVAL_LONG(result, Z_LVAL_P(op1) ? 1 : 0); in compare_function()
1456 ZVAL_LONG(result, ZEND_NORMALIZE_BOOL(Z_LVAL_P(op1) - Z_LVAL_P(op2))); in compare_function()
1460 zendi_smart_strcmp(result, op1, op2); in compare_function()
1464 ZVAL_LONG(result, zend_binary_strcmp("", 0, Z_STRVAL_P(op2), Z_STRLEN_P(op2))); in compare_function()
1468 ZVAL_LONG(result, zend_binary_strcmp(Z_STRVAL_P(op1), Z_STRLEN_P(op1), "", 0)); in compare_function()
1472 ZVAL_LONG(result, 1); in compare_function()
1476 ZVAL_LONG(result, -1); in compare_function()
1484 ZVAL_LONG(result, 0); in compare_function()
1487 ZVAL_LONG(result, Z_OBJ_HT_P(op1)->compare_objects(op1, op2 TSRMLS_CC)); in compare_function()
1496 ret = compare_function(result, op_free, op2 TSRMLS_CC); in compare_function()
1502 ZVAL_LONG(result, 1); in compare_function()
1506 ret = compare_function(result, op_free, op2 TSRMLS_CC); in compare_function()
1514 ret = compare_function(result, op1, op_free TSRMLS_CC); in compare_function()
1520 ZVAL_LONG(result, -1); in compare_function()
1524 ret = compare_function(result, op1, op_free TSRMLS_CC); in compare_function()
1528 ZVAL_LONG(result, 1); in compare_function()
1534 zendi_convert_to_boolean(op2, op2_copy, result); in compare_function()
1535 ZVAL_LONG(result, Z_LVAL_P(op2) ? -1 : 0); in compare_function()
1538 zendi_convert_to_boolean(op1, op1_copy, result); in compare_function()
1539 ZVAL_LONG(result, Z_LVAL_P(op1) ? 1 : 0); in compare_function()
1542 zendi_convert_to_boolean(op2, op2_copy, result); in compare_function()
1543 ZVAL_LONG(result, ZEND_NORMALIZE_BOOL(Z_LVAL_P(op1) - Z_LVAL_P(op2))); in compare_function()
1546 zendi_convert_to_boolean(op1, op1_copy, result); in compare_function()
1547 ZVAL_LONG(result, ZEND_NORMALIZE_BOOL(Z_LVAL_P(op1) - Z_LVAL_P(op2))); in compare_function()
1550 zendi_convert_scalar_to_number(op1, op1_copy, result); in compare_function()
1551 zendi_convert_scalar_to_number(op2, op2_copy, result); in compare_function()
1555 ZVAL_LONG(result, 1); in compare_function()
1558 ZVAL_LONG(result, -1); in compare_function()
1561 ZVAL_LONG(result, 1); in compare_function()
1564 ZVAL_LONG(result, -1); in compare_function()
1567 ZVAL_LONG(result, 0); in compare_function()
1577 zval result; in hash_zval_identical_function() local
1585 if (is_identical_function(&result, (zval *) *z1, (zval *) *z2 TSRMLS_CC)==FAILURE) { in hash_zval_identical_function()
1588 return !Z_LVAL(result); in hash_zval_identical_function()
1592 ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in is_identical_function() argument
1594 Z_TYPE_P(result) = IS_BOOL; in is_identical_function()
1596 Z_LVAL_P(result) = 0; in is_identical_function()
1601 Z_LVAL_P(result) = 1; in is_identical_function()
1606 Z_LVAL_P(result) = (Z_LVAL_P(op1) == Z_LVAL_P(op2)); in is_identical_function()
1609 Z_LVAL_P(result) = (Z_DVAL_P(op1) == Z_DVAL_P(op2)); in is_identical_function()
1612 Z_LVAL_P(result) = ((Z_STRLEN_P(op1) == Z_STRLEN_P(op2)) in is_identical_function()
1616 Z_LVAL_P(result) = (Z_ARRVAL_P(op1) == Z_ARRVAL_P(op2) || in is_identical_function()
1621 Z_LVAL_P(result) = (Z_OBJ_HANDLE_P(op1) == Z_OBJ_HANDLE_P(op2)); in is_identical_function()
1623 Z_LVAL_P(result) = 0; in is_identical_function()
1627 Z_LVAL_P(result) = 0; in is_identical_function()
1634 ZEND_API int is_not_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in is_not_identical_function() argument
1636 if (is_identical_function(result, op1, op2 TSRMLS_CC) == FAILURE) { in is_not_identical_function()
1639 Z_LVAL_P(result) = !Z_LVAL_P(result); in is_not_identical_function()
1644 ZEND_API int is_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in is_equal_function() argument
1646 if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) { in is_equal_function()
1649 ZVAL_BOOL(result, (Z_LVAL_P(result) == 0)); in is_equal_function()
1654 ZEND_API int is_not_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in is_not_equal_function() argument
1656 if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) { in is_not_equal_function()
1659 ZVAL_BOOL(result, (Z_LVAL_P(result) != 0)); in is_not_equal_function()
1664 ZEND_API int is_smaller_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in is_smaller_function() argument
1666 if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) { in is_smaller_function()
1669 ZVAL_BOOL(result, (Z_LVAL_P(result) < 0)); in is_smaller_function()
1674 ZEND_API int is_smaller_or_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ in is_smaller_or_equal_function() argument
1676 if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) { in is_smaller_or_equal_function()
1679 ZVAL_BOOL(result, (Z_LVAL_P(result) <= 0)); in is_smaller_or_equal_function()
1915 register unsigned char *result = (unsigned char*)dest; in zend_str_tolower_copy() local
1919 *result++ = zend_tolower((int)*str++); in zend_str_tolower_copy()
1921 *result = '\0'; in zend_str_tolower_copy()
2044 ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2) /* {{{ */ argument
2068 ZVAL_LONG(result, -1 * oflow2);
2074 ZVAL_LONG(result, oflow1);
2083 Z_DVAL_P(result) = dval1 - dval2;
2084 ZVAL_LONG(result, ZEND_NORMALIZE_BOOL(Z_DVAL_P(result)));
2086 ZVAL_LONG(result, lval1 > lval2 ? 1 : (lval1 < lval2 ? -1 : 0));
2090 Z_LVAL_P(result) = zend_binary_zval_strcmp(s1, s2);
2091 ZVAL_LONG(result, ZEND_NORMALIZE_BOOL(Z_LVAL_P(result)));
2098 zval result; local
2100 if (compare_function(&result, (zval *) *z1, (zval *) *z2 TSRMLS_CC)==FAILURE) {
2103 return Z_LVAL(result);
2113 ZEND_API void zend_compare_symbol_tables(zval *result, HashTable *ht1, HashTable *ht2 TSRMLS_DC) /*… argument
2115 …ZVAL_LONG(result, ht1 == ht2 ? 0 : zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_…
2119 ZEND_API void zend_compare_arrays(zval *result, zval *a1, zval *a2 TSRMLS_DC) /* {{{ */ argument
2121 zend_compare_symbol_tables(result, Z_ARRVAL_P(a1), Z_ARRVAL_P(a2) TSRMLS_CC);
2125 ZEND_API void zend_compare_objects(zval *result, zval *o1, zval *o2 TSRMLS_DC) /* {{{ */ argument
2127 Z_TYPE_P(result) = IS_LONG;
2130 Z_LVAL_P(result) = 0;
2135 Z_LVAL_P(result) = 1;
2137 Z_LVAL_P(result) = Z_OBJ_HT_P(o1)->compare_objects(o1, o2 TSRMLS_CC);