Re: Need routine to tell me number of dimensions in array.

From: Date: Tue, 16 Mar 2010 16:12:56 +0000
Subject: Re: Need routine to tell me number of dimensions in array.
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-302899@lists.php.net to get a copy of this message
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 the COW realizes the copy's pointer has moved and splits off the copy. You can verify this by echoing the memory usage when you first enter carray(). The spike occurs inside the foreach loop. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP

« previous php.general (#302899) next »