|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-02-13 09:39 UTC] nikic@php.net
-Status: Open
+Status: Not a bug
[2018-02-13 09:39 UTC] nikic@php.net
[2018-02-14 20:52 UTC] johnpaulwallway at gmail dot com
[2018-02-14 21:17 UTC] requinix@php.net
[2018-02-14 21:58 UTC] johnpaulwallway at gmail dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 30 03:00:01 2025 UTC |
Description: ------------ E_RECOVERABLE_ERROR halts the interpreter. While shutdown_function is called, one cannot handle framework shutdown, responses, and logging in an appropriate manner. E_RECOVERABLE_ERROR should be catchable by a `catch( Throwable $t)` or `catch(ERROR $e)`, and finally blocks _must_ be executed. Test script: --------------- <?php $x = new stdClass(); try { echo $x; } catch (Throwable $t) { echo "Yeah, we couldn't convert that to a string. Log error and respond to client's request"; echo $t->__toString(); } finally { echo "Seriously? I must be wrong"; } Expected result: ---------------- Something like: Yeah, we couldn't convert that to a string. Log error and respond to client's request. E_RECOVERABLE_ERROR: Object of class stdClass could not be converted to string Seriously? I must be wrong Actual result: -------------- PHP Catchable fatal error: Object of class stdClass could not be converted to string in /tmp/foo.php on line 5 PHP Stack trace: PHP 1. {main}() /tmp/foo.php:0 Catchable fatal error: Object of class stdClass could not be converted to string in /tmp/foo.php on line 5