From:             johfivealive at hotmail dot com
Operating system: Fedora Core 2
PHP version:      5.0.0RC3
PHP Bug Type:     Zend Engine 2 problem
Bug description:  Parse error caused by "valid" array/string syntax

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 bug report at http://bugs.php.net/?id=29021&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=29021&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=29021&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=29021&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=29021&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=29021&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=29021&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=29021&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=29021&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=29021&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=29021&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=29021&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=29021&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29021&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=29021&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=29021&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=29021&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29021&r=float

Reply via email to