Re: Re: Liveuser_Admin: listing users alphabetically

From: Date: Tue, 06 Sep 2005 13:15:07 +0000
Subject: Re: Re: Liveuser_Admin: listing users alphabetically
References: 1 2 3 4 5 6 7 8  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-20813@lists.php.net to get a copy of this message
Jeroen Houben wrote:
Lukas Smith wrote:
Jeroen Houben wrote:
Some more investigation shows that findTables(&$fields, &$filters, &$orders, $selectable_tables) is somehow resetting $orders.
resetting? as in emptying? that method should just ensure the proper aliasing and/or table prefixing in the keys of the $orders array.
Well I'm sure it should, but before it enters that function $orders is an array (as specified in my previous post) and when the findTables() function is excecuted $orders is an empty array. Since you pass $orders by reference, it is possible to change it's value. I don't know exactly what's going on but if I remove the & from the method signature, it works fine. I don't really understand the passing by reference bit here anyway, $orders will never be a really huge array that will benefit from not being copied (speedwise).
FYI: The following bit inside findTables() seems to cause $oders to be reset:
                   if (array_key_exists($field, $orders)) {
                       $orders[$this->alias[$field]] = $orders[$field];
                       unset($orders[$field]);
                   }
Jeroen

« previous php.pear.general (#20813) next »