Bug #75842 [Opn->Nab]: String concatenation
| From: | requinix@php.net | Date: | Thu, 18 Jan 2018 14:56:39 +0000 |
| Subject: | Bug #75842 [Opn->Nab]: String concatenation | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-213607@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=75842&edit=1
ID: 75842
Updated by: requinix@php.net
Reported by: george at t-c-n dot co dot uk
Summary: String concatenation
-Status: Open
+Status: Not a bug
Type: Bug
Package: *General Issues
Operating System: Windows 10
PHP Version: 7.2.1
Block user comment: N
Private report: N
New Comment:
No, it's valid syntax. Assignment is an expression that evaluates to the RHS value, so
$x = 'hello' . $y = 'world';
works like
$y = 'world';
$x = 'hello' . 'world';
Previous Comments:
------------------------------------------------------------------------
[2018-01-18 14:53:21] george at t-c-n dot co dot uk
Description:
------------
Not sure if this is a bug or not but I guess reporting it anyway wouldn't hurt.
String concatenation with '=', should this be a syntax error?
Test script:
---------------
<?php
$x = 'hello' .
$y = 'world';
echo $x;
OR
<?php
$x = 'hello' . $y = 'world';
echo $x;
Expected result:
----------------
Syntax error?
Actual result:
--------------
'helloworld'
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=75842&edit=1