Originariamente inviato da yangtze
Forse ho trovato qualcosa e... sembra funzionare:

codice:
function cerror($eno,$estr,$efile,$eline) {
        
		 if (error_reporting()) {
			$type=array(1=>'Fatal',2=>'Warning',4=>'Parse',8=>'Notice');
			
			if ( isset( $type[ $eno ] ) )
				$etype = $type[ $eno ];
			else
				$etype = 'Unknow';
			
			echo '[php.error] [type|'.$etype.' n|'.$eno.'] ['.$estr.'] sul file ['.$efile.'] linea ['.$eline.'] per la ['.$_SERVER['REQUEST_URI'].']'."\n";
		}
        
        
    }
non sapevo che error_reporting si potesse usare così ma un tizio che ha scritto un commento sulla guida ufficiale di PHP l'ha fatto
Un altro dice che bisogna usare:
codice:
if(error_reporting() != 0){
(esplicitando cioè il "diverso da 0")