php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #60319 PHP shorthand syntax
Submitted: 2011-11-17 13:27 UTC Modified: 2012-08-10 18:47 UTC
Votes:3
Avg. Score:3.7 ± 0.9
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:0 (0.0%)
From: deepakbalanimail at gmail dot com Assigned:
Status: Wont fix Package: *General Issues
PHP Version: 5.3.8 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: deepakbalanimail at gmail dot com
New email:
PHP Version: OS:

 

 [2011-11-17 13:27 UTC] deepakbalanimail at gmail dot com
Description:
------------
This is feature request:-

PHP needs a more efficient shorthand syntax. PHP already has the shorthand syntax for <?php echo $expr ?> = <?= $expr ?>. 

But this thing will become nightmare when we want to use some flow control.

<?php if(true): ?>
<?= 'True' ?>
<?php else: ?>
<?= 'False' ?>
<?php endif; ?>

In this example we have to mix both type of syntax. So we need to make <?= ?> capable to process decision instructions.



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-11-18 15:39 UTC] anon at anon dot anon
Yuck. Why would you code like that? Keep it in a single tag. <?php echo true ? 'True' : 'False'; ?>
 [2011-11-19 05:38 UTC] deepakbalanimail at gmail dot com
@anon 

This is just an example, not the actual problem.
 [2011-11-19 12:11 UTC] anon at anon dot anon
It's a very poor example then isn't it.
 [2012-08-10 18:47 UTC] nikic@php.net
-Status: Open +Status: Wont fix
 [2012-08-10 18:47 UTC] nikic@php.net
PHP already has <? as an alias for <?php if short_open_tags is enabled. It doesn't get shorter than that.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 11 12:01:33 2024 UTC