#29021 [Opn->Bgs]: Parse error caused by "valid" array/string syntax
| From: | derick@php.net | Date: | Tue, 06 Jul 2004 07:12:10 +0000 |
| Subject: | #29021 [Opn->Bgs]: Parse error caused by "valid" array/string syntax | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-61749@lists.php.net to get a copy of this message | ||
ID: 29021
Updated by: derick@php.net
Reported By: johfivealive at hotmail dot com
-Status: Open
+Status: Bogus
Bug Type: Zend Engine 2 problem
Operating System: Fedora Core 2
PHP Version: 5.0.0RC3
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
You can only have static array initializations, concatting to a string
like you do is not supported.
Previous Comments:
------------------------------------------------------------------------
[2004-07-05 20:12:21] johfivealive at hotmail dot com
Description:
------------
I think this should not be a parse error, this should work. It seems
the concatenation of LOGIK_CONFIG_FILE to the string:
"<span class=\"error\"><strong></strong> couldn't be opened
for
reading.<br />Check file permissions.</span>"
is causing the parse error.
Reproduce code:
---------------
define( "LOGIK_DIRECTORY", $_SERVER['DOCUMENT_ROOT'] . "/" );
define( "LOGIK_CONFIG_DIRECTORY", "config/" );
define( "LOGIK_CONFIG_FILE", LOGIK_DIRECTORY . LOGIK_CONFIG_DIRECTORY .
"logikconfig.xml" );
define( "LOGIK_CONFIG_FILE_FOPEN_ERROR", 3 );
static $errors = array(
LOGIK_CONFIG_FILE_FOPEN_ERROR => "<span
class=\"error\"><strong>" . LOGIK_CONFIG_FILE . "</strong>
couldn't be
opened for reading.<br />Check file permissions.</span>"
);
The above array() creation syntax is what throws the parse error.
Expected result:
----------------
This shouldn't be a parse error because it is valid string
concatenation syntax.
Actual result:
--------------
PHP reprts the following error:
Parse error: parse error, unexpected '.', expecting ')'
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=29021&edit=1