#38711 [Opn->Bgs]: Expression with class constants erreor

From: Date: Mon, 04 Sep 2006 11:32:29 +0000
Subject: #38711 [Opn->Bgs]: Expression with class constants erreor
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-101709@lists.php.net to get a copy of this message
 ID:               38711
 Updated by:       tony2001@php.net
 Reported By:      jd at trickytools dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Compile Failure
 Operating System: Linux RedHat 4
 PHP Version:      5.1.6
 New Comment:

Expressions cannot be executed in compile time, when class
constants/members are declared.
This is expected behaviour.


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

[2006-09-04 11:25:41] jd at trickytools dot com

Description:
------------
It seems that initializing static class member with constant expression
generates a syntax error

Reproduce code:
---------------
<?php
class C {
static public $m = 1 + 2;  // syntax error !
};
?>


Expected result:
----------------
There should not be any compilation error

Actual result:
--------------
PHP Parse error:  syntax error, unexpected '(' in
/var/www/html/test.php on line 3



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


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


Thread (2 messages)

« previous php.bugs (#101709) next »