php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64245 concatenating reference & string is confusing
Submitted: 2013-02-19 17:00 UTC Modified: 2013-02-19 17:14 UTC
From: fool at example dot com Assigned:
Status: Closed Package: Variables related
PHP Version: 5.4.11 OS: archlinux
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: fool at example dot com
New email:
PHP Version: OS:

 

 [2013-02-19 17:00 UTC] fool at example dot com
Description:
------------
$ php -a
Interactive shell

php > $a = 'ab';
php > $b = 'cc'.&$a;
PHP Parse error:  syntax error, unexpected '&' in php shell code on line 1

Parse error: syntax error, unexpected '&' in php shell code on line 1

php > $b = &$a.'cc'; // no error
php > echo $b; // and 'cc' is ignored
abphp > 



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-02-19 17:14 UTC] fool at example dot com
Assign By Reference
 [2013-02-19 17:14 UTC] fool at example dot com
-: femrat at gmail dot com +: fool at example dot com -Status: Open +Status: Closed
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 01 20:01:36 2025 UTC