#37979 [WFx]: new string separator

From: Date: Sun, 02 Jul 2006 19:32:20 +0000
Subject: #37979 [WFx]: new string separator
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-99044@lists.php.net to get a copy of this message
 ID:               37979
 User updated by:  vandor at freestart dot hu
 Reported By:      vandor at freestart dot hu
 Status:           Wont fix
 Bug Type:         Feature/Change Request
 Operating System: All
 PHP Version:      6CVS-2006-07-01 (CVS)
 New Comment:

What about using [string] or {string} or :string: ?
These separators can't occur at the same place as a string.


Previous Comments:
------------------------------------------------------------------------

[2006-07-01 08:13:03] derick@php.net

The # is already used for comments... so we can't use it here.

------------------------------------------------------------------------

[2006-07-01 00:36:35] 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.



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=37979&edit=1


Thread (3 messages)

« previous php.bugs (#99044) next »