php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #27109 magic string concat
Submitted: 2004-01-31 13:33 UTC Modified: 2004-01-31 13:47 UTC
Votes:2
Avg. Score:1.0 ± 0.0
Reproduced:0 of 2 (0.0%)
From: xuefer at 21cn dot com Assigned:
Status: Wont fix Package: Feature/Change Request
PHP Version: 5CVS-2004-01-31 (dev) OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: xuefer at 21cn dot com
New email:
PHP Version: OS:

 

 [2004-01-31 13:33 UTC] xuefer at 21cn dot com
Description:
------------
as we know, in C/C++, const string will be concat magically
char *str = "FOO" "BAR";

but in php, we used dot '.' to concat, which is widely used as object.method() method.property in other languages, there isn't much symbols on our keyboard, this make php have to use $this->foo() $this->bar for objects
many and many times we type "-" shift + ">" :(

i suggest that php should be able to do:
$hello = "hell" "o";
$hello = $hello " wo"; // same as $hello = $hello . " wo";
$hello .= "rld"; // still, and ever supported

space between expressions means string-concat

$query = "select abc"
 " from table"
 " where ...";

we don't have to:
$query = "select abc"
 . " from table"
 . " where ...";

or:
$query = "select abc" .
 " from table" .
 " where ...";
(hard to modify)

or:
$query = "select abc
  from table
  where ...";
(ugly)

php is for web, web is text, text is string
hope one day all code is written with out using dot concat (.) so we can deprecate it, and then disabled, and we can $phpers.smile(";)")



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-01-31 13:47 UTC] derick@php.net
We love our dots, it's the language and so it will be. We're not going to change this.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 27 23:01:30 2024 UTC