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

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

 



On Sat, 08 Aug 2009 16:05:20 +0100, Ashley Sheridan 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?

Well in this case [array_slice()], I'd say you most probably
want to keep the original array intact. In other cases,
such as sort() or array_push(), you really want to modify
the array you pass to them.

The implementors have probably tried to pick the most
reasonable method for each function, and it seems to work
out well for me. But I'm only guessing.


/Nisse

-- 
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