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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux