Bug #15682 Updated: Bitwise concatenation of constants in class variables
| From: | derick@php.net | Date: | Fri, 22 Feb 2002 23:43:02 +0000 |
| Subject: | Bug #15682 Updated: Bitwise concatenation of constants in class variables | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-849@lists.php.net to get a copy of this message | ||
ID: 15682
Updated by: derick@php.net
Reported By: s-m-k@gmx.net
-Status: Open
+Status: Bogus
Bug Type: Class/Object related
Operating System: WinXP
PHP Version: 4.1.1
New Comment:
Not a bug. You can only use static assignments here:
From the manual @ http://www.php.net/manual/en/language.oop.php
:
Note: In PHP 4, only constant initializers for var variables are
allowed. To initialize variables with non-constant values, you need an
initialization function which is called automatically when an object is
being constructed from the class. Such a function is called a
constructor (see below).
regards,
Derick
Previous Comments:
------------------------------------------------------------------------
[2002-02-22 17:15:40] s-m-k@gmx.net
class foo {
var $bar = E_ALL & ~E_NOTICE;
}
Obviously a scalar value (assigning a single value works perfectly),
but
the following appears when it comes to execution:
Parse error: parse error, expecting "," or ";"
------------------------------------------------------------------------
[2002-02-22 17:14:17] s-m-k@gmx.net
class foo {
$var bar = E_ALL & ~E_NOTICE;
}
Obviously a scalar value (assigning a single value works perfectly),
but the following appears when it comes to execution:
Parse error: parse error, expecting "," or ";"
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=15682&edit=1