From:             kenaniah at gmail dot com
Operating system: Linux
PHP version:      5.3.1
PHP Bug Type:     Feature/Change Request
Bug description:  Resume after Exceptions

Description:
------------
I think that PHP would benefit greatly by implementing a feature known as
"resumeable" exceptions. The end goal would be to provide a method by which
code execution may be continued from the point at which an exception was
thrown. 

Naturally, some exceptions should not be resumeable by nature, which would
require an extension to the Exception class of a simple boolean property
indicating whether an instance of that exception can be resumed or not. 

The only real problem AFAICS with resumeable exceptions has to do with the
state of the execution stack. Obviously, if execution were to be resumed
after an exception is handled, the stack can not be unwound automatically
(Schrodinger's cat, anyone?). 

My suggestion would be to allow another keyword besides "catch" (such as
"resume") to handle exceptions. If a resumeable exception is thrown and
caught in a "resume" block, the parser should proceed as if it were
handling a function call. In short, the unwinding of the execution stack
would need to be deferred until it is determined whether or not execution
will be resumed at the point of the exception.


-- 
Edit bug report at http://bugs.php.net/?id=50726&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=50726&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=50726&r=trysnapshot53
Try a snapshot (PHP 6.0):            
http://bugs.php.net/fix.php?id=50726&r=trysnapshot60
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=50726&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=50726&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=50726&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=50726&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=50726&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=50726&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=50726&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=50726&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=50726&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=50726&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=50726&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=50726&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=50726&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=50726&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=50726&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=50726&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=50726&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=50726&r=mysqlcfg

Reply via email to