note 112594 added to function.array-push
| From: | hacfi | Date: | Wed, 03 Jul 2013 02:57:31 +0000 |
| Subject: | note 112594 added to function.array-push | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-195437@lists.php.net to get a copy of this message | ||
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;
}
?>
----
Server IP: 212.124.37.9
Probable Submitter: 93.220.96.217
----
Manual Page -- http://php.net/manual/en/function.array-push.php
Edit -- https://master.php.net/note/edit/112594
Del: integrated -- https://master.php.net/note/delete/112594/integrated
Del: useless -- https://master.php.net/note/delete/112594/useless
Del: bad code -- https://master.php.net/note/delete/112594/bad+code
Del: spam -- https://master.php.net/note/delete/112594/spam
Del: non-english -- https://master.php.net/note/delete/112594/non-english
Del: in docs -- https://master.php.net/note/delete/112594/in+docs
Del: other reasons-- https://master.php.net/note/delete/112594
Reject -- https://master.php.net/note/reject/112594
Search -- https://master.php.net/manage/user-notes.php