php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #30432 Add alternate syntax
Submitted: 2004-10-14 14:33 UTC Modified: 2004-10-14 14:42 UTC
Votes:2
Avg. Score:3.0 ± 2.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:2 (100.0%)
From: vivers at one dot net Assigned:
Status: Wont fix Package: Feature/Change Request
PHP Version: 5.0.2 OS: All
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: vivers at one dot net
New email:
PHP Version: OS:

 

 [2004-10-14 14:33 UTC] vivers at one dot net
Description:
------------
Can you add alternate syntax for try ... catch?  Something like:

try :
 ...
catch () :
 ...
endtry;

I'm using exceptions on presentation pages and this syntax would make the source much more readable.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-10-14 14:42 UTC] derick@php.net
Nope, we won't add more "old-style" alternative syntax like this.
 [2011-10-31 12:03 UTC] christian dot reinecke at web dot de
Can you explain why you declined that?

Because I'm not the only one using the alternative syntax in views/templates, especially for if/elseif/else and some old-school pages that do not have anything like a controller require try/catch statements mixed in HTML, so that syntax would really help.
 [2012-10-21 07:17 UTC] kriss at krizalys dot com
Whether or not this will ever be added to the official PHP release, there is a similar proposed patch for PHP 5.4 here:  https://bugs.php.net/bug.php?id=62164
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 12:01:29 2024 UTC