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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 02:01:30 2024 UTC