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
Have you experienced this issue?
Rate the importance of this bug to you:

 [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

Add a Patch

Pull Requests

Add a Pull Request

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: Thu May 02 15:01:33 2024 UTC