From: zedar at zedar dot org Operating system: Linux 2.4.26 PHP version: 5CVS-2005-03-11 (dev) PHP Bug Type: Unknown/Other Function Bug description: Error handling doesn't work properly.
Description: ------------ I have set an error handler to handle E_ALL errors, but i still get standard PHP error messages in some instances. Reproduce code: --------------- function debug ($errno, $errstr, $errfile, $errline, $errcontext) { print "<pre>"; print "Error: $errstr"; $backtrace = debug_backtrace (); $first = 1; $i = 1; foreach ($backtrace as $context) { if ($first) { $first = 0; } else { print "\n\t$i: $context[file] line $context[line] "; if ($context['class']) { print "(".$context['class']."->".$context['function'].")"; } elseif ($context['function']) { print "(".$context['function'].")"; } $i++; } } print "</pre>"; } set_error_handler ('debug', E_ALL); Expected result: ---------------- Very verbose debug output such as: Error: Use of undefined constant self - assumed 'self' 1: /www2/wame.net/system/include/class/dbObject.php line 169 (dbObject->cacheData) 2: /www2/wame.net/system/include/class/dbObject.php line 128 (ProviderRealm->cacheData) 3: /www2/wame.net/system/include/class/dbObject.php line 240 (ProviderRealm->dbRead) 4: /www2/wame.net/system/include/class/dbObject.php line 203 (ProviderRealm->dbWrite) 5: /www2/wame.net/system/include/class/dbObject.php line 203 (Provider->__destruct) 6: /www2/wame.net/system/include/class/dbObject.php line 203 (Provider->dbWrite) 7: line (dbObject->__destruct) Actual result: -------------- Note that this is not the same error as above, as this error is the one the handler doesn't deal with properly. Fatal error: Access to undeclared static property: dbObject::$_elements in /www2/wame.net/system/include/class/dbObject.php on line 212 -- Edit bug report at http://bugs.php.net/?id=32272&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32272&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=32272&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=32272&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=32272&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=32272&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=32272&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=32272&r=needscript Try newer version: http://bugs.php.net/fix.php?id=32272&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=32272&r=support Expected behavior: http://bugs.php.net/fix.php?id=32272&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=32272&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=32272&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=32272&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32272&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=32272&r=dst IIS Stability: http://bugs.php.net/fix.php?id=32272&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=32272&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=32272&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=32272&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=32272&r=mysqlcfg