note 96446 added to language.oop5.decon

From: Date: Sat, 27 Feb 2010 11:20:04 +0000
Subject: note 96446 added to language.oop5.decon
Groups: php.notes 
Request: Send a blank email to php-notes+get-166430@lists.php.net to get a copy of this message
The manual page says that throwing an exception from a destructor causes a fatal error; I've found that this only happens when the exception is _uncaught_ within the context of that destructor. If you catch it within that same destructor it seems to be fine. This is equally true of other contexts, such as: - shutdown functions set with register_shutdown_function - destructors - custom session close functions - custom error handlers - perhaps other similar contexts An exception normally 'bubbles up' to higher and higher contexts until it is caught, but because a destructor or shutdown function is called not within execution flow but in response to a special PHP event, the exception is unable to be traced back any further than the destructor or shutdown function in which it is called. ---- Server IP: 69.147.83.197 Probable Submitter: 119.12.174.145 ---- Manual Page -- http://www.php.net/manual/en/language.oop5.decon.php Edit -- https://master.php.net/note/edit/96446 Del: integrated -- https://master.php.net/note/delete/96446/integrated Del: useless -- https://master.php.net/note/delete/96446/useless Del: bad code -- https://master.php.net/note/delete/96446/bad+code Del: spam -- https://master.php.net/note/delete/96446/spam Del: non-english -- https://master.php.net/note/delete/96446/non-english Del: in docs -- https://master.php.net/note/delete/96446/in+docs Del: other reasons-- https://master.php.net/note/delete/96446 Reject -- https://master.php.net/note/reject/96446 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#166430) next »