From:             adam dot huttler at fracturedatlas dot org
Operating system: Linux
PHP version:      5.2.3
PHP Bug Type:     Class/Object related
Bug description:  can't concatenate when defining class constant 

Description:
------------
When defining a global constant, you can concatenate a string to another
constant. Doing this with class constants causes a parse error.

If this isn't considered a bug, please consider it a feature request, as
it would be very useful for configuration (especially file paths).

Thanks.

Reproduce code:
---------------
define('FOO', 'foo'); 

class Foobar 
{ 
    const MESSAGE = FOO . 'bar'; 
}

echo Foobar::MESSAGE;

Expected result:
----------------
foobar

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

-- 
Edit bug report at http://bugs.php.net/?id=42355&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=42355&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=42355&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=42355&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=42355&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=42355&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=42355&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=42355&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=42355&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=42355&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=42355&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=42355&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=42355&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=42355&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=42355&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=42355&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=42355&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=42355&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=42355&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=42355&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=42355&r=mysqlcfg

Reply via email to