php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38836 string concatenation operator does not work across multiple lines in classes
Submitted: 2006-09-15 05:34 UTC Modified: 2006-09-15 07:02 UTC
From: evoltech at 2inches dot com Assigned:
Status: Not a bug Package: Strings related
PHP Version: 5CVS-2006-09-15 (snap) OS: Linux
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: evoltech at 2inches dot com
New email:
PHP Version: OS:

 

 [2006-09-15 05:34 UTC] evoltech at 2inches dot com
Description:
------------
PHP is great!  I love this language, and I apreciate the work of the developers ... you are all very awesome!

The following code works as I expect:
<?php
$var = "this" .
   "that" .
   "other\n";
print $var;
?>
thisthatother

When I use the concatenation operator in a class however I get a parse error.

Reproduce code:
---------------
<?php
class foo
{
   public static $var = "this" .
      "that" .
      "other\n";
}
print foo::$var;
?>

Expected result:
----------------
thisthatother


Actual result:
--------------
Parse error: syntax error, unexpected '.', expecting ',' or ';'

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-09-15 07:02 UTC] tony2001@php.net
Expressions are not allowed when declaring class members and constants.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 13:01:28 2024 UTC