@@ -88,7 +88,7 @@ function array_replace_recursive(array $array, array ...$replacements): array
8888 error_clear_last ();
8989 if ($ replacements !== []) {
9090 $ result = \array_replace_recursive ($ array , ...$ replacements );
91- } else {
91+ }else {
9292 $ result = \array_replace_recursive ($ array );
9393 }
9494 if ($ result === null ) {
@@ -123,7 +123,7 @@ function array_replace(array $array, array ...$replacements): array
123123 error_clear_last ();
124124 if ($ replacements !== []) {
125125 $ result = \array_replace ($ array , ...$ replacements );
126- } else {
126+ }else {
127127 $ result = \array_replace ($ array );
128128 }
129129 if ($ result === null ) {
@@ -149,18 +149,18 @@ function array_replace(array $array, array ...$replacements): array
149149 * reference. Then,
150150 * any changes made to those elements will be made in the
151151 * 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,
153153 * it will be passed as the third parameter to the
154154 * callback.
155155 * @throws ArrayException
156156 *
157157 */
158- function array_walk_recursive (array &$ array , callable $ callback , $ userdata = null ): void
158+ function array_walk_recursive (array &$ array , callable $ callback , $ arg = null ): void
159159{
160160 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 {
164164 $ result = \array_walk_recursive ($ array , $ callback );
165165 }
166166 if ($ result === false ) {
@@ -170,7 +170,7 @@ function array_walk_recursive(array &$array, callable $callback, $userdata = nul
170170
171171
172172/**
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
174174 * correlation with the array elements they are associated with.
175175 *
176176 * This is used mainly when sorting associative arrays where the actual
@@ -228,7 +228,7 @@ function arsort(array &$array, int $flags = SORT_REGULAR): void
228228
229229
230230/**
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
232232 * their correlation with the array elements they are associated
233233 * with. This is used mainly when sorting associative arrays where
234234 * the actual element order is significant.
@@ -285,7 +285,7 @@ function asort(array &$array, int $flags = SORT_REGULAR): void
285285
286286
287287/**
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
289289 * correlations. This is useful mainly for associative arrays.
290290 *
291291 * @param array $array The input array.
@@ -340,7 +340,7 @@ function krsort(array &$array, int $flags = SORT_REGULAR): void
340340
341341
342342/**
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
344344 * useful mainly for associative arrays.
345345 *
346346 * @param array $array The input array.
@@ -438,7 +438,7 @@ function natsort(array &$array): void
438438
439439
440440/**
441- * This function sorts an array in reverse order (highest to lowest) .
441+ * This function sorts an array by value in descending order .
442442 *
443443 * @param array $array The input array.
444444 * @param int $flags The optional second parameter flags
@@ -511,8 +511,7 @@ function shuffle(array &$array): void
511511
512512
513513/**
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.
516515 *
517516 * @param array $array The input array.
518517 * @param int $flags The optional second parameter flags
@@ -634,3 +633,4 @@ function usort(array &$array, callable $callback): void
634633 throw ArrayException::createFromPhpError ();
635634 }
636635}
636+
0 commit comments