#26431 [Opn->Bgs]: Expressions in class constants using << don't seem to work?
| From: | derick@php.net | Date: | Thu, 27 Nov 2003 09:04:00 +0000 |
| Subject: | #26431 [Opn->Bgs]: Expressions in class constants using << don't seem to work? | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-51151@lists.php.net to get a copy of this message | ||
ID: 26431
Updated by: derick@php.net
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