|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-12-10 22:59 UTC] tony2001@php.net
[2005-12-11 13:52 UTC] elg at op dot pl
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 19 22:00:01 2025 UTC |
Description: ------------ I wanted to convert errors to exceptions by writing an error handler that throws them as exceptions. Then I wanted to check if it works so I tried to include a non existing file (info.txt) Reproduce code: --------------- <?php function exceptionHandler($exc){ echo ':)'; } function ErrorsToExceptions($severity, $message) { throw new ErrorException($message,0, $severity); } set_exception_handler('exceptionHandler'); set_error_handler('ErrorsToExceptions'); include'dupa.txt'; ?> Expected result: ---------------- :) Actual result: -------------- Warning: main() [function.include]: Failed opening 'info.txt' for inclusion (include_path='.;C:\php5\pear') in E:\usr\\www\index.php on line 8 :)