note 36837 added to function.array-values

From: Date: Fri, 24 Oct 2003 07:36:31 +0000
Subject: note 36837 added to function.array-values
Groups: php.notes 
Request: Send a blank email to php-notes+get-59204@lists.php.net to get a copy of this message
Just a warning that re-indexing an array by array_values() may cause you to reach the memory limit unexpectly. For example, if your PHP momory_limits is 8MB, and says there's a BIG array $bigArray which allocate 5MB of memory. Doing this will cause PHP exceeds the momory limits: $bigArray = array_values( $bigArray ); It's because array_values() does not re-index $bigArray directly, it just re-index it into another array, and assign to itself later. ---- Manual Page -- http://www.php.net/manual/en/function.array-values.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+36837 Delete -- http://master.php.net/manage/user-notes.php?action=delete+36837&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+36837&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#59204) next »