diff options
Diffstat (limited to 'ext/standard/array.c')
| -rw-r--r-- | ext/standard/array.c | 138 |
1 files changed, 61 insertions, 77 deletions
diff --git a/ext/standard/array.c b/ext/standard/array.c index 66fe142383..15b43643b8 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -387,8 +387,7 @@ static void php_natsort(INTERNAL_FUNCTION_PARAMETERS, int fold_case) target_hash = HASH_OF(*array); if (!target_hash) { - php_error(E_WARNING, "%s(): The argument should be an array", - get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The argument should be an array"); return; } @@ -553,7 +552,7 @@ PHP_FUNCTION(usort) } target_hash = HASH_OF(*array); if (!target_hash) { - php_error(E_WARNING, "%s(): The argument should be an array", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The argument should be an array"); BG(user_compare_func_name) = old_compare_func; RETURN_FALSE; } @@ -581,7 +580,7 @@ PHP_FUNCTION(uasort) } target_hash = HASH_OF(*array); if (!target_hash) { - php_error(E_WARNING, "%s(): The argument should be an array", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The argument should be an array"); BG(user_compare_func_name) = old_compare_func; RETURN_FALSE; } @@ -656,7 +655,7 @@ PHP_FUNCTION(uksort) } target_hash = HASH_OF(*array); if (!target_hash) { - php_error(E_WARNING, "%s(): The argument should be an array", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The argument should be an array"); BG(user_compare_func_name) = old_compare_func; RETURN_FALSE; } @@ -681,7 +680,7 @@ PHP_FUNCTION(end) } target_hash = HASH_OF(*array); if (!target_hash) { - php_error(E_WARNING, "%s(): Passed variable is not an array or object", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Passed variable is not an array or object"); RETURN_FALSE; } zend_hash_internal_pointer_end(target_hash); @@ -709,7 +708,7 @@ PHP_FUNCTION(prev) } target_hash = HASH_OF(*array); if (!target_hash) { - php_error(E_WARNING, "%s(): Passed variable is not an array or object", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Passed variable is not an array or object"); RETURN_FALSE; } zend_hash_move_backwards(target_hash); @@ -737,7 +736,7 @@ PHP_FUNCTION(next) } target_hash = HASH_OF(*array); if (!target_hash) { - php_error(E_WARNING, "%s(): Passed variable is not an array or object", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Passed variable is not an array or object"); RETURN_FALSE; } zend_hash_move_forward(target_hash); @@ -765,7 +764,7 @@ PHP_FUNCTION(reset) } target_hash = HASH_OF(*array); if (!target_hash) { - php_error(E_WARNING, "%s(): Passed variable is not an array or object", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Passed variable is not an array or object"); RETURN_FALSE; } zend_hash_internal_pointer_reset(target_hash); @@ -793,7 +792,7 @@ PHP_FUNCTION(current) } target_hash = HASH_OF(*array); if (!target_hash) { - php_error(E_WARNING, "%s(): Passed variable is not an array or object", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Passed variable is not an array or object"); RETURN_FALSE; } if (zend_hash_get_current_data(target_hash, (void **) &entry) == FAILURE) { @@ -819,7 +818,7 @@ PHP_FUNCTION(key) } target_hash = HASH_OF(*array); if (!target_hash) { - php_error(E_WARNING, "%s(): Passed variable is not an array or object", get_active_function_name (TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Passed variable is not an array or object"); RETURN_FALSE; } switch (zend_hash_get_current_key_ex(target_hash, &string_key, &string_length, &num_key, 0, NULL)) { @@ -843,7 +842,7 @@ PHP_FUNCTION(min) pval **result; if (argc<=0) { - php_error(E_WARNING, "%s(): Atleast one value should be passed", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Atleast one value should be passed"); RETURN_NULL(); } set_compare_func(SORT_REGULAR TSRMLS_CC); @@ -857,7 +856,7 @@ PHP_FUNCTION(min) *return_value = **result; zval_copy_ctor(return_value); } else { - php_error(E_WARNING, "%s(): Array must contain atleast one element", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array must contain atleast one element"); RETURN_FALSE; } } else { @@ -895,7 +894,7 @@ PHP_FUNCTION(max) pval **result; if (argc<=0) { - php_error(E_WARNING, "%s(): Atleast one value should be passed", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Atleast one value should be passed"); RETURN_NULL(); } set_compare_func(SORT_REGULAR TSRMLS_CC); @@ -909,7 +908,7 @@ PHP_FUNCTION(max) *return_value = **result; zval_copy_ctor(return_value); } else { - php_error(E_WARNING, "%s(): Array must contain atleast one element", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array must contain atleast one element"); RETURN_FALSE; } } else { @@ -976,8 +975,7 @@ static int php_array_walk(HashTable *target_hash, zval **userdata TSRMLS_DC) zval_ptr_dtor(&retval_ptr); } else - php_error(E_WARNING, "%s(): Unable to call %s() - function does not exist", - get_active_function_name(TSRMLS_C), + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call %s() - function does not exist", (*BG(array_walk_func_name))->value.str.val); zend_hash_move_forward_ex(target_hash, &pos); @@ -1006,15 +1004,13 @@ PHP_FUNCTION(array_walk) } target_hash = HASH_OF(*array); if (!target_hash) { - php_error(E_WARNING, "%s(): The argument should be an array", - get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The argument should be an array"); BG(array_walk_func_name) = old_walk_func_name; RETURN_FALSE; } if (Z_TYPE_PP(BG(array_walk_func_name)) != IS_ARRAY && Z_TYPE_PP(BG(array_walk_func_name)) != IS_STRING) { - php_error(E_WARNING, "%s(): Wrong syntax for function name", - get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Wrong syntax for function name"); BG(array_walk_func_name) = old_walk_func_name; RETURN_FALSE; } @@ -1048,12 +1044,12 @@ static void php_search_array(INTERNAL_FUNCTION_PARAMETERS, int behavior) } if (Z_TYPE_PP(value) == IS_OBJECT) { - php_error(E_WARNING, "%s(): Wrong datatype for first argument", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Wrong datatype for first argument"); RETURN_FALSE; } if (Z_TYPE_PP(array) != IS_ARRAY) { - php_error(E_WARNING, "%s(): Wrong datatype for second argument", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Wrong datatype for second argument"); RETURN_FALSE; } @@ -1160,8 +1156,7 @@ PHP_FUNCTION(extract) convert_to_long_ex(z_extract_type); extract_type = Z_LVAL_PP(z_extract_type); if (extract_type > EXTR_SKIP && extract_type <= EXTR_PREFIX_IF_EXISTS) { - php_error(E_WARNING, "%s(): Prefix expected to be specified", - get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Prefix expected to be specified"); return; } break; @@ -1181,14 +1176,12 @@ PHP_FUNCTION(extract) } if (extract_type < EXTR_OVERWRITE || extract_type > EXTR_IF_EXISTS) { - php_error(E_WARNING, "%s(): Unknown extract type", - get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown extract type"); return; } if (Z_TYPE_PP(var_array) != IS_ARRAY) { - php_error(E_WARNING, "%s(): First argument should be an array", - get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "First argument should be an array"); return; } @@ -1363,7 +1356,7 @@ PHP_FUNCTION(array_fill) zend_hash_index_update(Z_ARRVAL_P(return_value), Z_LVAL_PP(start_key), val, sizeof(val), NULL); break; default: - php_error(E_WARNING, "%s(): Wrong data type for start key", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Wrong data type for start key"); RETURN_FALSE; break; } @@ -1371,7 +1364,7 @@ PHP_FUNCTION(array_fill) convert_to_long_ex(num); i = Z_LVAL_PP(num) - 1; if(i<0) { - php_error(E_WARNING, "%s(): Number of elements must be positive", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of elements must be positive"); RETURN_FALSE; } newval = *val; @@ -1635,7 +1628,7 @@ PHP_FUNCTION(array_push) /* Get first argument and check that it's an array */ stack = *args[0]; if (Z_TYPE_P(stack) != IS_ARRAY) { - php_error(E_WARNING, "%s(): First argument should be an array", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "First argument should be an array"); efree(args); RETURN_FALSE; } @@ -1671,7 +1664,7 @@ static void _phpi_pop(INTERNAL_FUNCTION_PARAMETERS, int off_the_end) } if (Z_TYPE_PP(stack) != IS_ARRAY) { - php_error(E_WARNING, "%s(): The argument should be an array", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The argument should be an array"); return; } @@ -1754,7 +1747,7 @@ PHP_FUNCTION(array_unshift) /* Get first argument and check that it's an array */ stack = *args[0]; if (Z_TYPE_P(stack) != IS_ARRAY) { - php_error(E_WARNING, "%s(): The first argument should be an array", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The first argument should be an array"); efree(args); RETURN_FALSE; } @@ -1804,7 +1797,7 @@ PHP_FUNCTION(array_splice) /* Get first argument and check that it's an array */ array = *args[0]; if (Z_TYPE_P(array) != IS_ARRAY) { - php_error(E_WARNING, "%s(): The first argument should be an array", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The first argument should be an array"); efree(args); return; } @@ -1879,7 +1872,7 @@ PHP_FUNCTION(array_slice) } if (Z_TYPE_PP(input) != IS_ARRAY) { - php_error(E_WARNING, "%s(): The first argument should be an array", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The first argument should be an array"); return; } @@ -2059,7 +2052,7 @@ PHP_FUNCTION(array_keys) } if (Z_TYPE_PP(input) != IS_ARRAY) { - php_error(E_WARNING, "%s(): The first argument should be an array", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The first argument should be an array"); return; } @@ -2116,7 +2109,7 @@ PHP_FUNCTION(array_values) } if (Z_TYPE_PP(input) != IS_ARRAY) { - php_error(E_WARNING, "%s(): The argument should be an array", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The argument should be an array"); return; } @@ -2153,7 +2146,7 @@ PHP_FUNCTION(array_count_values) } if (Z_TYPE_PP(input) != IS_ARRAY) { - php_error(E_WARNING, "%s(): The argument should be an array", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The argument should be an array"); return; } @@ -2190,7 +2183,7 @@ PHP_FUNCTION(array_count_values) Z_LVAL_PP(tmp)++; } } else { - php_error(E_WARNING, "%s(): Can only count STRING and INTEGER values!", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can only count STRING and INTEGER values!"); } zend_hash_move_forward_ex(myht, &pos); @@ -2219,7 +2212,7 @@ PHP_FUNCTION(array_reverse) } if (Z_TYPE_PP(input) != IS_ARRAY) { - php_error(E_WARNING, "%s(): The argument should be an array", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The argument should be an array"); return; } @@ -2279,8 +2272,7 @@ PHP_FUNCTION(array_pad) /* Make sure arguments are of the proper type */ if (Z_TYPE_PP(input) != IS_ARRAY) { - php_error(E_WARNING, "%s(): The argument should be an array", - get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The argument should be an array"); return; } convert_to_long_ex(pad_size); @@ -2338,7 +2330,7 @@ PHP_FUNCTION(array_flip) target_hash = HASH_OF(*array); if (!target_hash) { - php_error(E_WARNING, "%s(): The argument should be an array", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The argument should be an array"); RETURN_FALSE; } @@ -2365,7 +2357,7 @@ PHP_FUNCTION(array_flip) zend_hash_update(Z_ARRVAL_P(return_value), Z_STRVAL_PP(entry), Z_STRLEN_PP(entry) + 1, &data, sizeof(data), NULL); } else { zval_ptr_dtor(&data); /* will free also zval structure */ - php_error(E_WARNING, "%s(): Can only flip STRING and INTEGER values!", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can only flip STRING and INTEGER values!"); } zend_hash_move_forward_ex(target_hash, &pos); @@ -2397,7 +2389,7 @@ PHP_FUNCTION(array_change_key_case) } if (Z_TYPE_PP(array) != IS_ARRAY) { - php_error(E_WARNING, "%s(): The argument should be an array", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The argument should be an array"); RETURN_FALSE; } @@ -2446,7 +2438,7 @@ PHP_FUNCTION(array_unique) } target_hash = HASH_OF(*array); if (!target_hash) { - php_error(E_WARNING, "%s(): The argument should be an array", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The argument should be an array"); RETURN_FALSE; } @@ -2517,7 +2509,7 @@ PHP_FUNCTION(array_intersect) set_compare_func(SORT_STRING TSRMLS_CC); for (i=0; i<argc; i++) { if (Z_TYPE_PP(args[i]) != IS_ARRAY) { - php_error(E_WARNING, "%s(): Argument #%d is not an array", get_active_function_name(TSRMLS_C), i+1); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is not an array", i+1); argc = i; /* only free up to i-1 */ goto out; } @@ -2622,7 +2614,7 @@ PHP_FUNCTION(array_diff) set_compare_func(SORT_STRING TSRMLS_CC); for (i=0; i<argc; i++) { if (Z_TYPE_PP(args[i]) != IS_ARRAY) { - php_error(E_WARNING, "%s(): Argument #%d is not an array", get_active_function_name(TSRMLS_C), i+1); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is not an array", i+1); argc = i; /* only free up to i-1 */ goto out; } @@ -2792,7 +2784,7 @@ PHP_FUNCTION(array_multisort) sort_order = Z_LVAL_PP(args[i]) == SORT_DESC ? -1 : 1; parse_state[MULTISORT_ORDER] = 0; } else { - php_error(E_WARNING, "%s(): Argument #%d is expected to be an array or sorting flag that has not already been specified", get_active_function_name(TSRMLS_C), i+1); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is expected to be an array or sorting flag that has not already been specified", i+1); MULTISORT_ABORT; } break; @@ -2806,19 +2798,19 @@ PHP_FUNCTION(array_multisort) sort_type = Z_LVAL_PP(args[i]); parse_state[MULTISORT_TYPE] = 0; } else { - php_error(E_WARNING, "%s(): Argument #%d is expected to be an array or sorting flag that has not already been specified", get_active_function_name(TSRMLS_C), i + 1); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is expected to be an array or sorting flag that has not already been specified", i + 1); MULTISORT_ABORT; } break; default: - php_error(E_WARNING, "%s(): Argument #%d is an unknown sort flag", get_active_function_name(TSRMLS_C), i + 1); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is an unknown sort flag", i + 1); MULTISORT_ABORT; break; } } else { - php_error(E_WARNING, "%s(): Argument #%d is expected to be an array or a sort flag", get_active_function_name(TSRMLS_C), i + 1); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is expected to be an array or a sort flag", i + 1); MULTISORT_ABORT; } } @@ -2830,7 +2822,7 @@ PHP_FUNCTION(array_multisort) array_size = zend_hash_num_elements(Z_ARRVAL_PP(arrays[0])); for (i = 0; i < num_arrays; i++) { if (zend_hash_num_elements(Z_ARRVAL_PP(arrays[i])) != array_size) { - php_error(E_WARNING, "%s(): Array sizes are inconsistent", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array sizes are inconsistent"); MULTISORT_ABORT; } } @@ -2927,8 +2919,7 @@ PHP_FUNCTION(array_rand) } if (Z_TYPE_PP(input) != IS_ARRAY) { - zend_error(E_WARNING, "Argument to %s() has to be an array", - get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "First argument has to be an array"); return; } @@ -2938,7 +2929,7 @@ PHP_FUNCTION(array_rand) convert_to_long_ex(num_req); num_req_val = Z_LVAL_PP(num_req); if (num_req_val <= 0 || num_req_val > num_avail) { - zend_error(E_WARNING, "Second argument to %s() has to be between 1 and the number of elements in the array", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Second argument has to be between 1 and the number of elements in the array"); return; } } else @@ -2999,8 +2990,7 @@ PHP_FUNCTION(array_sum) } if (Z_TYPE_PP(input) != IS_ARRAY) { - php_error(E_WARNING, "%s(): The argument should be an array", - get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The argument should be an array"); return; } @@ -3050,14 +3040,12 @@ PHP_FUNCTION(array_reduce) } if (Z_TYPE_PP(input) != IS_ARRAY) { - php_error(E_WARNING, "%s(): The first argument should be an array", - get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The first argument should be an array"); return; } if (!zend_is_callable(*callback, 0, &callback_name)) { - php_error(E_WARNING, "%s(): The second argument, '%s', should be a valid callback", - get_active_function_name(TSRMLS_C), callback_name); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The second argument, '%s', should be a valid callback", callback_name); efree(callback_name); return; } @@ -3085,7 +3073,7 @@ PHP_FUNCTION(array_reduce) zval_ptr_dtor(&result); result = retval; } else { - php_error(E_WARNING, "%s(): An error occurred while invoking the reduction callback", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred while invoking the reduction callback"); return; } } else { @@ -3123,15 +3111,13 @@ PHP_FUNCTION(array_filter) } if (Z_TYPE_PP(input) != IS_ARRAY) { - php_error(E_WARNING, "%s(): The first argument shouldbe an array", - get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The first argument shouldbe an array"); return; } if (ZEND_NUM_ARGS() > 1) { if (!zend_is_callable(*callback, 0, &callback_name)) { - php_error(E_WARNING, "%s(): The second argument, '%s', should be a valid callback", - get_active_function_name(TSRMLS_C), callback_name); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The second argument, '%s', should be a valid callback", callback_name); efree(callback_name); return; } @@ -3155,7 +3141,7 @@ PHP_FUNCTION(array_filter) } else zval_ptr_dtor(&retval); } else { - php_error(E_WARNING, "%s(): An error occurred while invoking the filter callback", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred while invoking the filter callback"); return; } } else if (!zend_is_true(*operand)) @@ -3204,7 +3190,7 @@ PHP_FUNCTION(array_map) callback = *args[0]; if (Z_TYPE_P(callback) != IS_NULL) { if (!zend_is_callable(callback, 0, &callback_name)) { - php_error(E_WARNING, "%s(): The first argument, '%s', should be either NULL or a valid callback", get_active_function_name(TSRMLS_C), callback_name); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The first argument, '%s', should be either NULL or a valid callback", callback_name); efree(callback_name); efree(args); return; @@ -3219,8 +3205,7 @@ PHP_FUNCTION(array_map) /* Check that arrays are indeed arrays and calculate maximum size. */ for (i = 0; i < ZEND_NUM_ARGS()-1; i++) { if (Z_TYPE_PP(args[i+1]) != IS_ARRAY) { - php_error(E_WARNING, "%s(): Argument #%d should be an array", - get_active_function_name(TSRMLS_C), i + 2); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d should be an array", i + 2); efree(array_len); efree(args); return; @@ -3291,7 +3276,7 @@ PHP_FUNCTION(array_map) if (Z_TYPE_P(callback) != IS_NULL) { if (!call_user_function_ex(EG(function_table), NULL, callback, &result, ZEND_NUM_ARGS()-1, params, 0, NULL TSRMLS_CC) == SUCCESS && result) { - php_error(E_WARNING, "%s(): An error occurred while invoking the map callback", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred while invoking the map callback"); efree(array_len); efree(args); efree(array_pos); @@ -3332,7 +3317,7 @@ PHP_FUNCTION(array_key_exists) } if (Z_TYPE_PP(array) != IS_ARRAY && Z_TYPE_PP(array) != IS_OBJECT) { - php_error(E_WARNING, "%s(): The second argument should be either an array or an object", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The second argument should be either an array or an object"); RETURN_FALSE; } @@ -3350,7 +3335,7 @@ PHP_FUNCTION(array_key_exists) RETURN_FALSE; default: - php_error(E_WARNING, "%s(): The first argument should be either a string or an integer", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The first argument should be either a string or an integer"); RETURN_FALSE; } @@ -3379,8 +3364,7 @@ PHP_FUNCTION(array_chunk) /* Do bounds checking for size parameter. */ if (size < 1) { - php_error(E_WARNING, "%s(): Size parameter expected to be greater than 0", - get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Size parameter expected to be greater than 0"); return; } |
