php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44910 Restrict GOTOs from/to try catch blocks
Submitted: 2008-05-04 12:22 UTC Modified: 2008-05-15 07:39 UTC
From: colder@php.net Assigned: dmitry (profile)
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.3CVS-2008-05-04 (CVS) OS: Irrelevant
Private report: No CVE-ID: None
 [2008-05-04 12:22 UTC] colder@php.net
Description:
------------
Currently, things like that are allowed:

try { ... plop: } catch(Exception $e) { goto plop; }

try { } catch(Exception1 $e) { goto plop; } catch(Exception2 $e) { plop: }

GOTOs shouldn't be allowed in those cases.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-05-15 07:39 UTC] dmitry@php.net
This is not a bug but a design decision.
According to it the only GOTO limitation is a prohibition to jump into loop or SWITCH statements. However, it may safely jump over try/catch boundaries.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 14 21:01:33 2025 UTC