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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 11:01:34 2024 UTC