php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #54936 alternative syntax for <?php ?>
Submitted: 2011-05-26 18:55 UTC Modified: 2011-05-26 19:50 UTC
From: giorgio dot liscio at email dot it Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 5.3.6 OS: any
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: giorgio dot liscio at email dot it
New email:
PHP Version: OS:

 

 [2011-05-26 18:55 UTC] giorgio dot liscio at email dot it
Description:
------------
hi, i don't know if there are some problems (parsing, security) with this, but an alternative syntax for php open and close tags would be really nice for xml

editors and xml parsers don't like php used like this:

<a href="<?php echo $item->getUrl(); ?>">Homepage</a>

so an alternative syntax, xml compatible, can be useful, for example:

<a href="[php[ echo $item->getUrl(); ]]">Homepage</a>


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-05-26 19:50 UTC] johannes@php.net
-Status: Open +Status: Bogus
 [2011-05-26 19:50 UTC] johannes@php.net
Most editors are aware of the PHP syntax.
Your propsed syntax won't work out as there is an conflict with statements like $a[$b[23]].
You can parse PHP anyways using an XML parset. In your example you'd at least have to write $item&gt;getUrl();.
You can write the code in a more "compatible" way. (echo '<a href="'.$item ....)
 [2011-05-26 21:31 UTC] giorgio dot liscio at email dot it
what about

<a href="^?php echo $item->url(); ?^">Home</a>
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 06 09:01:32 2025 UTC