#26050 [Opn->Bgs]: Unable to use CONST vars in other CONST vars
| From: | sniper@php.net | Date: | Fri, 31 Oct 2003 13:40:16 +0000 |
| Subject: | #26050 [Opn->Bgs]: Unable to use CONST vars in other CONST vars | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-49761@lists.php.net to get a copy of this message | ||
ID: 26050
Updated by: sniper@php.net
Reported By: kris dot hofmans at pandora dot be
-Status: Open
+Status: Bogus
Bug Type: Zend Engine 2 problem
Operating System: Linux 2.4.21
PHP Version: 5CVS-2003-10-31 (dev)
New Comment:
"Head up! I'm reverting the patch which allows for expressions in
constant declerations. Allowing the access of other constants in this
code is flawed. We are reverting back to PHP 4's static scalars." --
Andi
Previous Comments:
------------------------------------------------------------------------
[2003-10-31 05:23:49] kris dot hofmans at pandora dot be
Description:
------------
I have had code that has been running with php5-dev versions since
July, wich now won't parse anymore.
I had declared a CONST in a class wich I used in another CONST below
it, this now gives a:
Parse error: parse 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:
--------------
Parse error: parse error, expecting ','' or ';'' in
/home/blacky/public_html/php5-dev/zen/ext/types.class.php on line 127
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=26050&edit=1