Re: Altering the error_reporting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



mike schreef:
couldn't a user-defined error handler work for this?

http://www.php.net/manual/en/function.set-error-handler.php

obviously it would require the script that has the error handler still
be parsable.

and the OP specified exactly that ... a parse error.

maybe a wrapper shell script around the php binary which stripped out
the info from the error message, but it just seems silly.

I still reckon it's more of a challenge just to get most of these
'students' to actually read anything that's burped out ... oh no its
a cmdline, I can't read that it's all in black and white, where are
the links?

feel me? (your gf did ... just checking if your still reading ;-) ... actually
that could be a fun way to test their observation skills random derogatory remarks
replacing [parts of] error messages. or a swedish chef error handler:

bork in file bork on line bork

but you get the info in the format:

handler ( int $errno , string $errstr [, string $errfile [, int
$errline [, array $errcontext ]]] )

you could print out the first two pieces, and not the last 3...


On Wed, Sep 3, 2008 at 5:10 PM, Jochem Maas <jochem@xxxxxxxxxxxxx> wrote:
Micah Gersten schreef:
This seems like a futile activity.  It's a waste of time to have to hunt
down an error if you can be told where it is.  I suggest spending time
improving coding standards that error chasing.
besides, try grepping the archives for the number of posts that post errors
which include the file and line number that ask what, why and where whatever
is
going wrong.

finding someone on that level who actually reads the complete error message
and attempts to act on it is a hard task by itself. :-D

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com



admin@xxxxxxxxxxxxxxxxxxx wrote:
I am looking for a way to alter the error_reporting(E_All)
 This displays Parse error: parse error, unexpected '}' in
/var/www/html/test.php on line 7

I want to remove the file location and line number from the error
to only produce
Parse error: parse error, unexpected '}'

Why? You may ask.

I am writting a code tester in php but i do not want to display the "in"
portion. This will make you find the error on your own. As a learning tool.

Understand I have error reporting off in the php.ini file and call the
errors in the php script with ini_set('display_errors', 1);.

I am sure this is doable I just cant figure out how to do this without
altering the php.ini file.



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux