ID:               26431
 Updated by:       [EMAIL PROTECTED]
 Reported By:      jonny at sanriowasteland dot net
-Status:           Open
+Status:           Bogus
 Bug Type:         Zend Engine 2 problem
 Operating System: Windows NT
 PHP Version:      5.0.0b2 (beta2)
 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

This is as it should be... no bug here.


Previous Comments:
------------------------------------------------------------------------

[2003-11-27 02:18:50] jonny at sanriowasteland dot net

Description:
------------
Class Constants cannot use  expressions, apparently they can only be
numbers or strings.

This could be similar to bug #25323, but php does not crash, just
returns a parse error.

Reproduce code:
---------------
<?php

class TestConstBreak
{
        const   SOME_EXPRESSION = 5+5;
        const   SOME_BIG_EXPRESSOIN = (5 + 2) * 3;
        const   LS_EXPRESSION   = 5<<2;
        const   SOME_STRING_EXPRESSION = "foo"."bar";
}

?>


Expected result:
----------------
The expected result is to be able to use expressions in class constants
without causing parse errors.

Actual result:
--------------
Parse error: parse error, unexpected '+', expecting ',' or ';' in
php5Breakage.php on line 5

When I comment out line 5:

Parse error: parse error, unexpected '(' in php5Breakage.php on line 6

And when I comment out line 6:

Parse error: parse error, unexpected T_SL, expecting ',' or ';' in
php5Breakage.php on line 7

And when I comment out line 7:

Parse error: parse error, unexpected ".", expecting ',' or ';' in
php5Breakage.php on line 7



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=26431&edit=1

Reply via email to