php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8033 parse error
Submitted: 2000-11-29 10:49 UTC Modified: 2001-05-11 21:37 UTC
From: ce at beer dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0.3pl1 OS: freebsd
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ce at beer dot com
New email:
PHP Version: OS:

 

 [2000-11-29 10:49 UTC] ce at beer dot com
$flags = ASD | DSA; //this one is OK

class test{
var $flags = ASD | DSA; // on this line it gives parse error
}

I downloaded the latest CVS - the same problem.
I havn't test with previous versions.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-11-29 10:51 UTC] stas@php.net
var initializers can be only constants.
 [2000-11-29 10:57 UTC] ce at beer dot com
define(ASD, 1);
define(DSA, 2);

$flags = ASD | DSA; //this one is OK

class test{
var $flags = ASD | DSA; // on this line it gives parse error
}

I downloaded the latest CVS - the same problem.
I havn't test with previous versions.

 [2000-11-29 11:10 UTC] ce at beer dot com
define(ASD, 1);
define(DSA, 2);

$flags = ASD | DSA; //this one is OK

class test{
var $flags = ASD | DSA; // on this line it gives parse error
}

I downloaded the latest CVS - the same problem.
I havn't test with previous versions.


 [2001-05-11 21:37 UTC] sniper@php.net
http://www.php.net/manual/en/language.oop.php

---8<----------
Note: In PHP 4, only constant initializers for var variables are allowed. Use constructors for non-constant initializers. 
--------8<-----


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon May 05 23:01:28 2025 UTC