On 17 March 2010 01:10, Robert Cummings wrote:
>
> Rene Veerman wrote:
>>
>> maybe you should be foreach()ing with references?
>> php.net : search "foreach" :
>>
>>
>> As of PHP 5, you can easily modify array's elements by preceding
>> $value with &. This will assign reference instead of copying t
Rene Veerman wrote:
maybe you should be foreach()ing with references?
php.net : search "foreach" :
As of PHP 5, you can easily modify array's elements by preceding
$value with &. This will assign reference instead of copying the
value.
This is possible only if iterated array can be referenced
maybe you should be foreach()ing with references?
php.net : search "foreach" :
As of PHP 5, you can easily modify array's elements by preceding
$value with &. This will assign reference instead of copying the
value.
This is possible only if iterated array can be referenced (i.e. is variable),
Peter Lind wrote:
Hmm, will probably have to look inside PHP for this ... the foreach
loop will copy each element as it loops over it (without actually
copying, obviously), however there's no change happening to the
element at any point and so there's nothing to suggest to the
copy-on-write to cr
Hmm, will probably have to look inside PHP for this ... the foreach
loop will copy each element as it loops over it (without actually
copying, obviously), however there's no change happening to the
element at any point and so there's nothing to suggest to the
copy-on-write to create a new instance
Peter Lind wrote:
This is one example where references actually decrease memory usage.
The main reason is the recursive nature of the function. Try
BTW, it's not the recursive nature of the function causing the problem.
It's the movement of the internal pointer within the array. When it
moves
Peter Lind wrote:
This is one example where references actually decrease memory usage.
The main reason is the recursive nature of the function. Try
Doh, forgot about that :)
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP
--
PHP General Mailing List (htt
This is one example where references actually decrease memory usage.
The main reason is the recursive nature of the function. Try
wrote:
>
>
> Richard Quadling wrote:
>>
>> On 15 March 2010 23:45, Daevid Vincent wrote:
>>>
>>> Anyone have a function that will return an integer of the number of
>
Richard Quadling wrote:
On 15 March 2010 23:45, Daevid Vincent wrote:
Anyone have a function that will return an integer of the number of
dimensions an array has?
/**
* Get the maximum depth of an array
*
* @param array &$Data A reference to the data array
* @return int The maximum numb
On 15 March 2010 23:45, Daevid Vincent wrote:
> Anyone have a function that will return an integer of the number of
> dimensions an array has?
/**
* Get the maximum depth of an array
*
* @param array &$Data A reference to the data array
* @return int The maximum number of levels in the array.
Jim Lucas wrote:
Daevid Vincent wrote:
Anyone have a function that will return an integer of the number of
dimensions an array has?
I did some quick searches and came up with nothing.
The closest was here of someone asking the same thing, but his solution
isn't right:
http://www.bigresource.c
Daevid Vincent wrote:
> Anyone have a function that will return an integer of the number of
> dimensions an array has?
>
> I did some quick searches and came up with nothing.
> The closest was here of someone asking the same thing, but his solution
> isn't right:
> http://www.bigresource.com/PHP-
end
> hours or days on one that works reliably. :)
>
>
> _
>
> From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk]
> Sent: Monday, March 15, 2010 4:44 PM
> Subject: Re: [PHP] Need routine to tell me number of dimensions in array
>
> The only way to do
y Sheridan [mailto:a...@ashleysheridan.co.uk]
Sent: Monday, March 15, 2010 4:44 PM
Subject: Re: [PHP] Need routine to tell me number of dimensions in array
The only way to do it reliably would be to iterate the entire array,
element by element, as all the elements of an array might not necessarily
On Mon, 2010-03-15 at 16:45 -0700, Daevid Vincent wrote:
> Anyone have a function that will return an integer of the number of
> dimensions an array has?
>
> I did some quick searches and came up with nothing.
> The closest was here of someone asking the same thing, but his solution
> isn't righ
Anyone have a function that will return an integer of the number of
dimensions an array has?
I did some quick searches and came up with nothing.
The closest was here of someone asking the same thing, but his solution
isn't right:
http://www.bigresource.com/PHP-count-array-dimensions-VrIahx1b.html
16 matches
Mail list logo