From: thiago dot silva at kdemail dot net
Operating system: Linux/slackware
PHP version: 5.0.5
PHP Bug Type: Feature/Change Request
Bug description: Error handling: @ operator behavior / __autoload() and
set_error_handler()
Description:
------------
The troublesome scenario:
Using a central __autoload() function to load all classes
of the application (wich uses libraries that uses
different file extensions):
function __autoload($classname) {
@include($classname.'.php');
if(class_exits($classname)) return;
@include($classname.'.class.php');
if(class_exits($classname)) return;
die("$classname not found");
}
Now, it is terrible to debug applications that use this
scheme. The @ operator supress fatal error messages. I
don't belive there is a point for this behavior. If one
doesn't want error messages, simply turn of the global
error_reporting option. Why expect a blank page for one or
two commands when something goes wrong?
Request #1: It would be desirable to have the @ operator
not supressing fatal error messages.
Now, in the __autoload() context, the user error handler
(setted with set_error_handler()) is not used, if we
remove the @ from include() statements. The warning
messages are sent to the default error handler (therefore,
to the output if display_errors is on).
Request #2: __autoload() should respect the current error
handler settings.
Related reports I've found:
#8294
#32545
--
Edit bug report at http://bugs.php.net/?id=35269&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=35269&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=35269&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=35269&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=35269&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=35269&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=35269&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=35269&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=35269&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=35269&r=support
Expected behavior: http://bugs.php.net/fix.php?id=35269&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=35269&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=35269&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=35269&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35269&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=35269&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=35269&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=35269&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=35269&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=35269&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=35269&r=mysqlcfg