I'm not super cleaar on what you are trying to do here (sort an objects properties by name within each object). When you talk about polluting the global space I'm assuming you are referring to the implementation of dsort, this can be contained in the class using this method:
protected static function dsort(&$array)
{
foreach ($array AS &$current)
{
if (is_array($current)) dsort($current);
}
ksort($array);
}
then invoked when needed (after replacing classname with the classes' name) by
$dsort = array("classname", "dsort");
$dsort($array);
or if you prefer
call_user_func(array("classname","dsort"), $array);