note 87661 added to function.array-push
| From: | willdemaine at gmail dot com | Date: | Mon, 15 Dec 2008 18:25:05 +0000 |
| Subject: | note 87661 added to function.array-push | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-148189@lists.php.net to get a copy of this message | ||
Bryan, the test is focused on the number of elements rather than the speed of an iteration. In the
last two examples, 10 items are added per iteration, 10000 times (= 100000 elements). The test shows
that for adding one item at a time it's faster to use the [] notation, whereas if you were
adding say 10 items at a time, array_push is quicker.
----
Server IP: 87.124.35.190
Probable Submitter: 82.7.69.186
----
Manual Page -- http://www.php.net/manual/en/function.array-push.php
Edit -- https://master.php.net/note/edit/87661
Del: integrated -- https://master.php.net/note/delete/87661/integrated
Del: useless -- https://master.php.net/note/delete/87661/useless
Del: bad code -- https://master.php.net/note/delete/87661/bad+code
Del: spam -- https://master.php.net/note/delete/87661/spam
Del: non-english -- https://master.php.net/note/delete/87661/non-english
Del: in docs -- https://master.php.net/note/delete/87661/in+docs
Del: other reasons-- https://master.php.net/note/delete/87661
Reject -- https://master.php.net/note/reject/87661
Search -- https://master.php.net/manage/user-notes.php