note 75326 added to language.types.array

From: Date: Thu, 24 May 2007 00:37:59 +0000
Subject: note 75326 added to language.types.array
Groups: php.notes 
Request: Send a blank email to php-notes+get-126859@lists.php.net to get a copy of this message
It's slightly faster to use array_splice to remove an element of an array: array_splice($array, $index, 1) than to do it using the suggested method of unset and reindex: unset($array[$index]); $array = array_values($array); The difference, however, is very small. With 950 iterations I had times of unset and reindex: 0.22837495803833 splice: 0.22392416000366 ---- Server IP: 64.71.164.2 Probable Submitter: 65.91.98.102 ---- Manual Page -- http://www.php.net/manual/en/language.types.array.php Edit -- https://master.php.net/note/edit/75326 Del: integrated -- https://master.php.net/note/delete/75326/integrated Del: useless -- https://master.php.net/note/delete/75326/useless Del: bad code -- https://master.php.net/note/delete/75326/bad+code Del: spam -- https://master.php.net/note/delete/75326/spam Del: non-english -- https://master.php.net/note/delete/75326/non-english Del: in docs -- https://master.php.net/note/delete/75326/in+docs Del: other reasons-- https://master.php.net/note/delete/75326 Reject -- https://master.php.net/note/reject/75326 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#126859) next »