Re: Re: does array_slice not work on multidimensional arrays?

From: Date: Sat, 08 Aug 2009 16:18:57 +0000
Subject: Re: Re: does array_slice not work on multidimensional arrays?
References: 1 2 3 4 5 6 7  Groups: php.general 
Request: Send a blank email to php-general+get-296484@lists.php.net to get a copy of this message
John Butler wrote:
It is annoying working with arrays sometimes, as some functions work on the actual array, while others return the results of working on the array without changing anything. Is there any particular reason for that?
...you mean what are the reasons for the different ways the arrays work? Then you must be asking the list in general (not me ;-))
Efficiency is often one of the reasons. Do you really want the overhead incurred by returning a copy of a 50000 member. Most of the sort functions work on the array itself. By working on the array itself, PHP offers you, the programmer, the choice of incurring the overhead since you can copy it before sorting. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP

« previous php.general (#296484) next »