/** * * Imprime uma árvore * @param Rubrica $father */ public static function printChildren($father) { if ($father != null) { echo $father->nome . '>>'; foreach ($father->filhas as $filha) { //echo '->>' .$filha->nome; Rubrica::printChildren($filha); } } /* if($father != null) foreach($father->filhas as $filha){ printChildren($filha); } */ }