note 33939 added to ref.errorfunc

From: Date: Fri, 11 Jul 2003 15:06:25 +0000
Subject: note 33939 added to ref.errorfunc
Groups: php.notes 
Request: Send a blank email to php-notes+get-51916@lists.php.net to get a copy of this message
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"); ---- Manual Page -- http://www.php.net/manual/en/ref.errorfunc.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33939 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33939&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33939&report=yes

« previous php.notes (#51916) next »