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
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: vandor at freestart dot hu
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 15 01:01:35 2025 UTC