summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/standard/array.c90
-rw-r--r--ext/standard/tests/array/array_merge.phpt2
-rw-r--r--ext/standard/tests/array/array_merge_error.phpt2
-rw-r--r--ext/standard/tests/array/array_merge_recursive_error.phpt2
-rw-r--r--ext/standard/tests/array/array_push.phpt10
-rw-r--r--ext/standard/tests/array/array_push_error1.phpt2
-rw-r--r--ext/standard/tests/array/array_push_variation1.phpt96
-rw-r--r--ext/standard/tests/array/array_unshift.phpt4
-rw-r--r--ext/standard/tests/array/array_unshift_error.phpt4
-rw-r--r--ext/standard/tests/array/array_unshift_variation1.phpt200
-rw-r--r--ext/standard/tests/array/compact_error.phpt2
11 files changed, 178 insertions, 236 deletions
diff --git a/ext/standard/array.c b/ext/standard/array.c
index 4c390d4c6a..e5c2536f46 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -1612,17 +1612,11 @@ static void php_compact_var(HashTable *eg_active_symbol_table, zval *return_valu
Creates a hash containing variables and their values */
PHP_FUNCTION(compact)
{
- zval ***args; /* function arguments array */
- int i;
-
- if (ZEND_NUM_ARGS() < 1) {
- WRONG_PARAM_COUNT;
- }
- args = (zval ***)safe_emalloc(ZEND_NUM_ARGS(), sizeof(zval **), 0);
-
- if (zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args) == FAILURE) {
- efree(args);
- WRONG_PARAM_COUNT;
+ zval ***args = NULL; /* function arguments array */
+ int num_args, i;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &num_args) == FAILURE) {
+ return;
}
if (!EG(active_symbol_table)) {
@@ -2091,29 +2085,12 @@ PHP_FUNCTION(array_push)
int i, /* Loop counter */
argc; /* Number of function arguments */
- /* Get the argument count and check it */
- argc = ZEND_NUM_ARGS();
- if (argc < 2) {
- WRONG_PARAM_COUNT;
- }
-
- /* Allocate arguments array and get the arguments, checking for errors. */
- args = (zval ***)safe_emalloc(argc, sizeof(zval **), 0);
- if (zend_get_parameters_array_ex(argc, args) == FAILURE) {
- efree(args);
- WRONG_PARAM_COUNT;
- }
-
- /* Get first argument and check that it's an array */
- stack = *args[0];
- if (Z_TYPE_P(stack) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "First argument should be an array");
- efree(args);
- RETURN_FALSE;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a+", &stack, &args, &argc) == FAILURE) {
+ return;
}
/* For each subsequent argument, make it a reference, increase refcount, and add it to the end of the array */
- for (i=1; i<argc; i++) {
+ for (i = 0; i < argc; i++) {
new_var = *args[i];
Z_ADDREF_P(new_var);
@@ -2224,30 +2201,13 @@ PHP_FUNCTION(array_unshift)
HashTable *new_hash; /* New hashtable for the stack */
int argc; /* Number of function arguments */
- /* Get the argument count and check it */
- argc = ZEND_NUM_ARGS();
- if (argc < 2) {
- WRONG_PARAM_COUNT;
- }
-
- /* Allocate arguments array and get the arguments, checking for errors. */
- args = (zval ***)safe_emalloc(argc, sizeof(zval **), 0);
- if (zend_get_parameters_array_ex(argc, args) == FAILURE) {
- efree(args);
- WRONG_PARAM_COUNT;
- }
-
- /* Get first argument and check that it's an array */
- stack = *args[0];
- if (Z_TYPE_P(stack) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The first argument should be an array");
- efree(args);
- RETURN_FALSE;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a+", &stack, &args, &argc) == FAILURE) {
+ return;
}
/* Use splice to insert the elements at the beginning. Destroy old
* hashtable and replace it with new one */
- new_hash = php_splice(Z_ARRVAL_P(stack), 0, 0, &args[1], argc - 1, NULL);
+ new_hash = php_splice(Z_ARRVAL_P(stack), 0, 0, &args[0], argc, NULL);
zend_hash_destroy(Z_ARRVAL_P(stack));
if (Z_ARRVAL_P(stack) == &EG(symbol_table)) {
zend_reset_all_cv(&EG(symbol_table) TSRMLS_CC);
@@ -2573,17 +2533,8 @@ static void php_array_merge_or_replace_wrapper(INTERNAL_FUNCTION_PARAMETERS, int
zval ***args = NULL;
int argc, i, params_ok = 1, init_size = 0;
- /* Get the argument count and check it */
- argc = ZEND_NUM_ARGS();
- if (argc < 1) {
- WRONG_PARAM_COUNT;
- }
-
- /* Allocate arguments array and get the arguments, checking for errors. */
- args = (zval ***)safe_emalloc(argc, sizeof(zval **), 0);
- if (zend_get_parameters_array_ex(argc, args) == FAILURE) {
- efree(args);
- WRONG_PARAM_COUNT;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &argc) == FAILURE) {
+ return;
}
for (i = 0; i < argc; i++) {
@@ -4031,18 +3982,9 @@ PHP_FUNCTION(array_multisort)
int sort_order = PHP_SORT_ASC;
int sort_type = PHP_SORT_REGULAR;
int i, k;
-
- /* Get the argument count and check it */
- argc = ZEND_NUM_ARGS();
- if (argc < 1) {
- WRONG_PARAM_COUNT;
- }
-
- /* Allocate arguments array and get the arguments, checking for errors. */
- args = (zval ***)safe_emalloc(argc, sizeof(zval **), 0);
- if (zend_get_parameters_array_ex(argc, args) == FAILURE) {
- efree(args);
- WRONG_PARAM_COUNT;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &argc) == FAILURE) {
+ return;
}
/* Allocate space for storing pointers to input arrays and sort flags. */
diff --git a/ext/standard/tests/array/array_merge.phpt b/ext/standard/tests/array/array_merge.phpt
index 8067ef5dd6..bb5a989dac 100644
--- a/ext/standard/tests/array/array_merge.phpt
+++ b/ext/standard/tests/array/array_merge.phpt
@@ -746,7 +746,7 @@ array(7) {
}
*** Testing error conditions ***
-Warning: Wrong parameter count for array_merge() in %s on line %d
+Warning: array_merge() expects at least 1 parameter, 0 given in %s on line %d
NULL
Warning: array_merge(): Argument #1 is not an array in %s on line %d
diff --git a/ext/standard/tests/array/array_merge_error.phpt b/ext/standard/tests/array/array_merge_error.phpt
index 613e5a65d9..a017c27530 100644
--- a/ext/standard/tests/array/array_merge_error.phpt
+++ b/ext/standard/tests/array/array_merge_error.phpt
@@ -25,6 +25,6 @@ echo "Done";
-- Testing array_merge() function with less than expected no. of arguments --
-Warning: Wrong parameter count for array_merge() in %s on line %d
+Warning: array_merge() expects at least 1 parameter, 0 given in %s on line %d
NULL
Done
diff --git a/ext/standard/tests/array/array_merge_recursive_error.phpt b/ext/standard/tests/array/array_merge_recursive_error.phpt
index b2fb1fd6d7..d7d717297e 100644
--- a/ext/standard/tests/array/array_merge_recursive_error.phpt
+++ b/ext/standard/tests/array/array_merge_recursive_error.phpt
@@ -20,6 +20,6 @@ echo "Done";
-- Testing array_merge_recursive() function with Zero arguments --
-Warning: Wrong parameter count for array_merge_recursive() in %s on line %d
+Warning: array_merge_recursive() expects at least 1 parameter, 0 given in %s on line %d
NULL
Done
diff --git a/ext/standard/tests/array/array_push.phpt b/ext/standard/tests/array/array_push.phpt
index ad9246cbf9..d43e69c21a 100644
--- a/ext/standard/tests/array/array_push.phpt
+++ b/ext/standard/tests/array/array_push.phpt
@@ -72,14 +72,14 @@ echo"\nDone";
--EXPECTF--
*** Testing Error Conditions ***
-Warning: Wrong parameter count for array_push() in %s on line %d
+Warning: array_push() expects at least 2 parameters, 0 given in %s on line %d
NULL
-Warning: array_push(): First argument should be an array in %s on line %d
-bool(false)
+Warning: array_push() expects parameter 1 to be array, integer given in %s on line %d
+NULL
-Warning: array_push(): First argument should be an array in %s on line %d
-bool(false)
+Warning: array_push() expects parameter 1 to be array, Unicode string given in %s on line %d
+NULL
int(11)
int(1)
diff --git a/ext/standard/tests/array/array_push_error1.phpt b/ext/standard/tests/array/array_push_error1.phpt
index 464aafc023..fe26fb697e 100644
--- a/ext/standard/tests/array/array_push_error1.phpt
+++ b/ext/standard/tests/array/array_push_error1.phpt
@@ -25,6 +25,6 @@ echo "Done";
-- Testing array_push() function with less than expected no. of arguments --
-Warning: Wrong parameter count for array_push() in %s on line %d
+Warning: array_push() expects at least 2 parameters, 1 given in %s on line %d
NULL
Done
diff --git a/ext/standard/tests/array/array_push_variation1.phpt b/ext/standard/tests/array/array_push_variation1.phpt
index bbc68086dd..db3957869c 100644
--- a/ext/standard/tests/array/array_push_variation1.phpt
+++ b/ext/standard/tests/array/array_push_variation1.phpt
@@ -102,124 +102,124 @@ echo "Done";
-- Iteration 1 --
-Warning: array_push(): First argument should be an array in %s on line %d
-bool(false)
+Warning: array_push() expects parameter 1 to be array, integer given in %s on line %d
+NULL
-- Iteration 2 --
-Warning: array_push(): First argument should be an array in %s on line %d
-bool(false)
+Warning: array_push() expects parameter 1 to be array, integer given in %s on line %d
+NULL
-- Iteration 3 --
-Warning: array_push(): First argument should be an array in %s on line %d
-bool(false)
+Warning: array_push() expects parameter 1 to be array, integer given in %s on line %d
+NULL
-- Iteration 4 --
-Warning: array_push(): First argument should be an array in %s on line %d
-bool(false)
+Warning: array_push() expects parameter 1 to be array, integer given in %s on line %d
+NULL
-- Iteration 5 --
-Warning: array_push(): First argument should be an array in %s on line %d
-bool(false)
+Warning: array_push() expects parameter 1 to be array, double given in %s on line %d
+NULL
-- Iteration 6 --
-Warning: array_push(): First argument should be an array in %s on line %d
-bool(false)
+Warning: array_push() expects parameter 1 to be array, double given in %s on line %d
+NULL
-- Iteration 7 --
-Warning: array_push(): First argument should be an array in %s on line %d
-bool(false)
+Warning: array_push() expects parameter 1 to be array, double given in %s on line %d
+NULL
-- Iteration 8 --
-Warning: array_push(): First argument should be an array in %s on line %d
-bool(false)
+Warning: array_push() expects parameter 1 to be array, double given in %s on line %d
+NULL
-- Iteration 9 --
-Warning: array_push(): First argument should be an array in %s on line %d
-bool(false)
+Warning: array_push() expects parameter 1 to be array, double given in %s on line %d
+NULL
-- Iteration 10 --
-Warning: array_push(): First argument should be an array in %s on line %d
-bool(false)
+Warning: array_push() expects parameter 1 to be array, null given in %s on line %d
+NULL
-- Iteration 11 --
-Warning: array_push(): First argument should be an array in %s on line %d
-bool(false)
+Warning: array_push() expects parameter 1 to be array, null given in %s on line %d
+NULL
-- Iteration 12 --
-Warning: array_push(): First argument should be an array in %s on line %d
-bool(false)
+Warning: array_push() expects parameter 1 to be array, boolean given in %s on line %d
+NULL
-- Iteration 13 --
-Warning: array_push(): First argument should be an array in %s on line %d
-bool(false)
+Warning: array_push() expects parameter 1 to be array, boolean given in %s on line %d
+NULL
-- Iteration 14 --
-Warning: array_push(): First argument should be an array in %s on line %d
-bool(false)
+Warning: array_push() expects parameter 1 to be array, boolean given in %s on line %d
+NULL
-- Iteration 15 --
-Warning: array_push(): First argument should be an array in %s on line %d
-bool(false)
+Warning: array_push() expects parameter 1 to be array, boolean given in %s on line %d
+NULL
-- Iteration 16 --
-Warning: array_push(): First argument should be an array in %s on line %d
-bool(false)
+Warning: array_push() expects parameter 1 to be array, Unicode string given in %s on line %d
+NULL
-- Iteration 17 --
-Warning: array_push(): First argument should be an array in %s on line %d
-bool(false)
+Warning: array_push() expects parameter 1 to be array, Unicode string given in %s on line %d
+NULL
-- Iteration 18 --
int(1)
-- Iteration 19 --
-Warning: array_push(): First argument should be an array in %s on line %d
-bool(false)
+Warning: array_push() expects parameter 1 to be array, Unicode string given in %s on line %d
+NULL
-- Iteration 20 --
-Warning: array_push(): First argument should be an array in %s on line %d
-bool(false)
+Warning: array_push() expects parameter 1 to be array, Unicode string given in %s on line %d
+NULL
-- Iteration 21 --
-Warning: array_push(): First argument should be an array in %s on line %d
-bool(false)
+Warning: array_push() expects parameter 1 to be array, Unicode string given in %s on line %d
+NULL
-- Iteration 22 --
-Warning: array_push(): First argument should be an array in %s on line %d
-bool(false)
+Warning: array_push() expects parameter 1 to be array, object given in %s on line %d
+NULL
-- Iteration 23 --
-Warning: array_push(): First argument should be an array in %s on line %d
-bool(false)
+Warning: array_push() expects parameter 1 to be array, null given in %s on line %d
+NULL
-- Iteration 24 --
-Warning: array_push(): First argument should be an array in %s on line %d
-bool(false)
+Warning: array_push() expects parameter 1 to be array, null given in %s on line %d
+NULL
-- Iteration 25 --
-Warning: array_push(): First argument should be an array in %s on line %d
-bool(false)
+Warning: array_push() expects parameter 1 to be array, resource given in %s on line %d
+NULL
Done
diff --git a/ext/standard/tests/array/array_unshift.phpt b/ext/standard/tests/array/array_unshift.phpt
index 8470715337..5f1a227964 100644
--- a/ext/standard/tests/array/array_unshift.phpt
+++ b/ext/standard/tests/array/array_unshift.phpt
@@ -21,8 +21,8 @@ array(1) {
unicode(0) ""
}
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, Unicode string given in %s on line %d
+NULL
array(1) {
[0]=>
unicode(0) ""
diff --git a/ext/standard/tests/array/array_unshift_error.phpt b/ext/standard/tests/array/array_unshift_error.phpt
index 3a5cd53ffe..1381111ec4 100644
--- a/ext/standard/tests/array/array_unshift_error.phpt
+++ b/ext/standard/tests/array/array_unshift_error.phpt
@@ -24,11 +24,11 @@ echo "Done";
-- Testing array_unshift() function with Zero arguments --
-Warning: Wrong parameter count for array_unshift() in %s on line %d
+Warning: array_unshift() expects at least 2 parameters, 0 given in %s on line %d
NULL
-- Testing array_unshift() function with less than expected no. of arguments --
-Warning: Wrong parameter count for array_unshift() in %s on line %d
+Warning: array_unshift() expects at least 2 parameters, 1 given in %s on line %d
NULL
Done
diff --git a/ext/standard/tests/array/array_unshift_variation1.phpt b/ext/standard/tests/array/array_unshift_variation1.phpt
index 08022e86a1..7fc6ec82e0 100644
--- a/ext/standard/tests/array/array_unshift_variation1.phpt
+++ b/ext/standard/tests/array/array_unshift_variation1.phpt
@@ -119,220 +119,220 @@ echo "Done";
*** Testing array_unshift() : unexpected values for $array argument ***
-- Iteration 1 --
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, integer given in %s on line %d
+NULL
int(0)
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, integer given in %s on line %d
+NULL
int(0)
-- Iteration 2 --
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, integer given in %s on line %d
+NULL
int(1)
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, integer given in %s on line %d
+NULL
int(1)
-- Iteration 3 --
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, integer given in %s on line %d
+NULL
int(12345)
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, integer given in %s on line %d
+NULL
int(12345)
-- Iteration 4 --
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, integer given in %s on line %d
+NULL
int(-2345)
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, integer given in %s on line %d
+NULL
int(-2345)
-- Iteration 5 --
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, double given in %s on line %d
+NULL
float(10.5)
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, double given in %s on line %d
+NULL
float(10.5)
-- Iteration 6 --
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, double given in %s on line %d
+NULL
float(-10.5)
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, double given in %s on line %d
+NULL
float(-10.5)
-- Iteration 7 --
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, double given in %s on line %d
+NULL
float(123456789000)
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, double given in %s on line %d
+NULL
float(123456789000)
-- Iteration 8 --
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, double given in %s on line %d
+NULL
float(1.23456789E-9)
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, double given in %s on line %d
+NULL
float(1.23456789E-9)
-- Iteration 9 --
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, double given in %s on line %d
+NULL
float(0.5)
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, double given in %s on line %d
+NULL
float(0.5)
-- Iteration 10 --
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, null given in %s on line %d
+NULL
NULL
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, null given in %s on line %d
+NULL
NULL
-- Iteration 11 --
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, null given in %s on line %d
+NULL
NULL
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, null given in %s on line %d
+NULL
NULL
-- Iteration 12 --
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, boolean given in %s on line %d
+NULL
bool(true)
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, boolean given in %s on line %d
+NULL
bool(true)
-- Iteration 13 --
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, boolean given in %s on line %d
+NULL
bool(false)
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, boolean given in %s on line %d
+NULL
bool(false)
-- Iteration 14 --
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, boolean given in %s on line %d
+NULL
bool(true)
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, boolean given in %s on line %d
+NULL
bool(true)
-- Iteration 15 --
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, boolean given in %s on line %d
+NULL
bool(false)
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, boolean given in %s on line %d
+NULL
bool(false)
-- Iteration 16 --
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, Unicode string given in %s on line %d
+NULL
unicode(0) ""
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, Unicode string given in %s on line %d
+NULL
unicode(0) ""
-- Iteration 17 --
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, Unicode string given in %s on line %d
+NULL
unicode(0) ""
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, Unicode string given in %s on line %d
+NULL
unicode(0) ""
-- Iteration 18 --
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, Unicode string given in %s on line %d
+NULL
unicode(6) "string"
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, Unicode string given in %s on line %d
+NULL
unicode(6) "string"
-- Iteration 19 --
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, Unicode string given in %s on line %d
+NULL
unicode(6) "string"
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, Unicode string given in %s on line %d
+NULL
unicode(6) "string"
-- Iteration 20 --
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, Unicode string given in %s on line %d
+NULL
unicode(11) "hello world"
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, Unicode string given in %s on line %d
+NULL
unicode(11) "hello world"
-- Iteration 21 --
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
-object(classA)#%d (0) {
+Warning: array_unshift() expects parameter 1 to be array, object given in %s on line %d
+NULL
+object(classA)#1 (0) {
}
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
-object(classA)#%d (0) {
+Warning: array_unshift() expects parameter 1 to be array, object given in %s on line %d
+NULL
+object(classA)#1 (0) {
}
-- Iteration 22 --
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, null given in %s on line %d
+NULL
NULL
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, null given in %s on line %d
+NULL
NULL
-- Iteration 23 --
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, null given in %s on line %d
+NULL
NULL
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
+Warning: array_unshift() expects parameter 1 to be array, null given in %s on line %d
+NULL
NULL
-- Iteration 24 --
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
-resource(%d) of type (stream)
+Warning: array_unshift() expects parameter 1 to be array, resource given in %s on line %d
+NULL
+resource(5) of type (stream)
-Warning: array_unshift(): The first argument should be an array in %s on line %d
-bool(false)
-resource(%d) of type (stream)
+Warning: array_unshift() expects parameter 1 to be array, resource given in %s on line %d
+NULL
+resource(5) of type (stream)
Done
diff --git a/ext/standard/tests/array/compact_error.phpt b/ext/standard/tests/array/compact_error.phpt
index d3d6e2cbbf..a7ef54597e 100644
--- a/ext/standard/tests/array/compact_error.phpt
+++ b/ext/standard/tests/array/compact_error.phpt
@@ -26,6 +26,6 @@ echo "Done";
-- Testing compact() function with Zero arguments --
-Warning: Wrong parameter count for compact() in %s on line %d
+Warning: compact() expects at least 1 parameter, 0 given in %s on line %d
NULL
Done