@@ -88,7 +88,7 @@ function array_replace_recursive(array $array, array ...$replacements): array
88
88
error_clear_last ();
89
89
if ($ replacements !== []) {
90
90
$ result = \array_replace_recursive ($ array , ...$ replacements );
91
- } else {
91
+ }else {
92
92
$ result = \array_replace_recursive ($ array );
93
93
}
94
94
if ($ result === null ) {
@@ -123,7 +123,7 @@ function array_replace(array $array, array ...$replacements): array
123
123
error_clear_last ();
124
124
if ($ replacements !== []) {
125
125
$ result = \array_replace ($ array , ...$ replacements );
126
- } else {
126
+ }else {
127
127
$ result = \array_replace ($ array );
128
128
}
129
129
if ($ result === null ) {
@@ -149,18 +149,18 @@ function array_replace(array $array, array ...$replacements): array
149
149
* reference. Then,
150
150
* any changes made to those elements will be made in the
151
151
* original array itself.
152
- * @param mixed $userdata If the optional userdata parameter is supplied,
152
+ * @param mixed $arg If the optional arg parameter is supplied,
153
153
* it will be passed as the third parameter to the
154
154
* callback.
155
155
* @throws ArrayException
156
156
*
157
157
*/
158
- function array_walk_recursive (array &$ array , callable $ callback , $ userdata = null ): void
158
+ function array_walk_recursive (array &$ array , callable $ callback , $ arg = null ): void
159
159
{
160
160
error_clear_last ();
161
- if ($ userdata !== null ) {
162
- $ result = \array_walk_recursive ($ array , $ callback , $ userdata );
163
- } else {
161
+ if ($ arg !== null ) {
162
+ $ result = \array_walk_recursive ($ array , $ callback , $ arg );
163
+ }else {
164
164
$ result = \array_walk_recursive ($ array , $ callback );
165
165
}
166
166
if ($ result === false ) {
@@ -170,7 +170,7 @@ function array_walk_recursive(array &$array, callable $callback, $userdata = nul
170
170
171
171
172
172
/**
173
- * This function sorts an array such that array indices maintain their
173
+ * This function sorts an array in descending order such that array indices maintain their
174
174
* correlation with the array elements they are associated with.
175
175
*
176
176
* This is used mainly when sorting associative arrays where the actual
@@ -228,7 +228,7 @@ function arsort(array &$array, int $flags = SORT_REGULAR): void
228
228
229
229
230
230
/**
231
- * This function sorts an array such that array indices maintain
231
+ * This function sorts an array in ascending order such that array indices maintain
232
232
* their correlation with the array elements they are associated
233
233
* with. This is used mainly when sorting associative arrays where
234
234
* the actual element order is significant.
@@ -285,7 +285,7 @@ function asort(array &$array, int $flags = SORT_REGULAR): void
285
285
286
286
287
287
/**
288
- * Sorts an array by key in reverse order, maintaining key to data
288
+ * Sorts an array by key in descending order, maintaining key to data
289
289
* correlations. This is useful mainly for associative arrays.
290
290
*
291
291
* @param array $array The input array.
@@ -340,7 +340,7 @@ function krsort(array &$array, int $flags = SORT_REGULAR): void
340
340
341
341
342
342
/**
343
- * Sorts an array by key, maintaining key to data correlations. This is
343
+ * Sorts an array by key in ascending order , maintaining key to data correlations. This is
344
344
* useful mainly for associative arrays.
345
345
*
346
346
* @param array $array The input array.
@@ -438,7 +438,7 @@ function natsort(array &$array): void
438
438
439
439
440
440
/**
441
- * This function sorts an array in reverse order (highest to lowest) .
441
+ * This function sorts an array by value in descending order .
442
442
*
443
443
* @param array $array The input array.
444
444
* @param int $flags The optional second parameter flags
@@ -511,8 +511,7 @@ function shuffle(array &$array): void
511
511
512
512
513
513
/**
514
- * This function sorts an array. Elements will be arranged from
515
- * lowest to highest when this function has completed.
514
+ * This function sorts an array by value in ascending order.
516
515
*
517
516
* @param array $array The input array.
518
517
* @param int $flags The optional second parameter flags
@@ -634,3 +633,4 @@ function usort(array &$array, callable $callback): void
634
633
throw ArrayException::createFromPhpError ();
635
634
}
636
635
}
636
+
0 commit comments