php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #37979 new string separator
Submitted: 2006-07-01 00:36 UTC Modified: 2006-07-02 19:32 UTC
From: vandor at freestart dot hu Assigned:
Status: Wont fix Package: Feature/Change Request
PHP Version: 6CVS-2006-07-01 (CVS) OS: All
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2006-07-01 00:36 UTC] vandor at freestart dot hu
Description:
------------
This is a feature request:

A new string separator character ie:#, with variable parsing

To write string contains double-quotes and variables have 4 different solution:
$s = "<p class=\"$class\" id=\"$id\">";
$s = '<p class="'.$class.'" id="'.$id.'">';
$s = <<<HEREDOC
<p class="$class" id="$id"
HEREDOC;
$s = sprintf('<p class="%s" id="%s">', $class, $id);

would suggest a 5th solution:
$s = #<p class="$class" id="$id"#;

Think it would produce cleaner, readable code when write html strings.

The # character used only for example, any may find a better one.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-07-01 08:13 UTC] derick@php.net
The # is already used for comments... so we can't use it here.
 [2006-07-02 19:32 UTC] vandor at freestart dot hu
What about using [string] or {string} or :string: ?
These separators can't occur at the same place as a string.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Jul 05 19:01:30 2024 UTC