note 112594 deleted from function.array-push by peehaa
| From: | peehaa@php.net | Date: | Tue, 21 Mar 2017 08:37:22 +0000 |
| Subject: | note 112594 deleted from function.array-push by peehaa | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-208915@lists.php.net to get a copy of this message | ||
Note Submitter: hacfi
----
I noticed that under certain circumstances it can be faster to use
<?php
call_user_func_array("array_push", array('x' => &$array1) +
array_values($array2));
?>
than
<?php
foreach ($array2 as $key => $value) {
$array1[] = $value;
}
?>