note 33939 deleted from ref.errorfunc by aidan

From: Date: Fri, 10 Sep 2004 06:51:38 +0000
Subject: note 33939 deleted from ref.errorfunc by aidan
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-76377@lists.php.net to get a copy of this message
Note Submitter: Warhog ---- For debugging it's sometimes nice if PHP directly shows the source of the line which caused the error! function my_error($nr, $text, $file, $line) { if (is_readable($file)) { $source = file($file); $source = htmlspecialchars($source[$line-1]); } else { $source = "<i>n/a</i>"; } die("error $nr in $file at $line: <div><code>$source</code></div>"); } error_reporting(0); set_error_handler("my_error");

« previous php.notes (#76377) next »