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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2019 The PHP Group
All rights reserved.
Last updated: Mon Sep 16 09:01:26 2019 UTC