Re: Create a hierarchical hash from flat source

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

 



On 06/22/2011 03:06 PM, Simon J Welsh wrote:
> On further inspection, that's not the problem at all. The problem's around assign_children($pid,$list,&$new);
> 
> The previous line you defined $new with $new = $leaf[$pid], *copying* that node into $new. Thus the assign_children() call updates $new, but not $lead[$pid].
> 
> You can fix this by either assigning $new by reference ($new =& $leaf[$pid]) or by passing a reference to $lead[$pid] to assign_children instead of $new.

I updated the code:

http://www.perturb.org/tmp/tree.txt

I still get the same output though. Only one level of depth :(

-- 
Scott Baker - Canby Telcom
System Administrator - RHCE - 503.266.8253

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