non ottieni nessun warning o notice??
prova a mettere un error_reporting(E_ALL); ad inizio pagina.