From: kris dot hofmans at pandora dot be
Operating system: Linux 2.4.21
PHP version: 5CVS-2003-10-31 (dev)
PHP Bug Type: Scripting Engine problem
Bug description: Unable to use CONST vars in other CONST vars

Description:
------------
I have had code that has been running with php5-dev versions since July,
wich now won't p anymore.

I had declared a CONST in a class wich I used in another CONST below it,
this now gives a:
P error: p error, expecting `','' or `';'' in
/home/blacky/public_html/php5-dev/zen/ext/types.class.php on line 127

I am using PHP 5 Beta 2 (currently not in the list)

Reproduce code:
---------------
const NUMERIC = '0-9';
const SPACE = '\s';
const PUNCTUATION = SPACE . '\.,;\:&"\'\?\!\(\)';
const ALPHA_LCASE = 'a-z';
const E_ALPHA_LCASE = ALPHA_LCASE . '';
const ALPHA_UCASE = 'A-Z';
const E_ALPHA_UCASE = ALPHA_UCASE . '';
const ALPHA = ALPHA_LCASE . ALPHA_UCASE;
const E_ALPHA = E_ALPHA_LCASE . E_ALPHA_UCASE;
const ALPHA_NUM = ALPHA . NUMERIC;

Expected result:
----------------
I expect the behaviour to be something like.

const FOO = 'foo';
const BAR = 'bar';
const FOOBAR = FOO . BAR;

and that an echo FOOBAR would give me the string 'foobar'

Actual result:
--------------
P error: p error, expecting `','' or `';'' in
/home/blacky/public_html/php5-dev/zen/ext/types.class.php on line 127

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