php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #4175 new class_name doesn't work in class definition
Submitted: 2000-04-18 07:37 UTC Modified: 2000-04-18 09:19 UTC
From: miroslav dot sulc at startnet dot cz Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0 Release Candidate 1 OS: Windows 98
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: miroslav dot sulc at startnet dot cz
New email:
PHP Version: OS:

 

 [2000-04-18 07:37 UTC] miroslav dot sulc at startnet dot cz
In my script I have:

some_class
{
   var $variable = new other_class_name;
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

   function ...
}

I get this error:

Parse error: parse error in class_file.php on line 9 (the underlined row)

My script worked fine in PHP3.

Is it erroreous syntax or error in engine?

Thank you.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-04-18 09:19 UTC] andrei at cvs dot php dot net
It's an incompatibility with PHP 3, by design. You cannot have dynamic
initializers for class members.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Sep 28 16:01:27 2024 UTC