php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13028 bug with empty Class Constructors
Submitted: 2001-08-29 09:12 UTC Modified: 2001-10-02 19:19 UTC
From: 40334233 at gmx dot net Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0.6 OS: Win2000
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: 40334233 at gmx dot net
New email:
PHP Version: OS:

 

 [2001-08-29 09:12 UTC] 40334233 at gmx dot net
I have had problems instanciating classes that have empty constructors defined. (PHP 4.05, win2000)

if a class has a constructor defined it seems that a (any) variable of that class must be set inside the constructor ot the class does not become properly instanciated. 
If there is no Constructor then this problem does not exist.

eg1, this works:
  class Foo   
  {
    var $a;

    function Foo()
    {
      $a = 1;
    }
  }

eg2, this does not work

  class Foo   
  {
    var $a;

    function Foo()
    {
      //empty constructor
    }
  }

eg3, this works

class Foo   
  {
    var $a;

    //no constructor defined

  }

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-08-30 08:49 UTC] dbeu@php.net
be a bit more precise...
what do you mean with "have had problems instanciating classes" and "the class does not become properly instanciated" ?
 [2001-10-02 19:19 UTC] sniper@php.net
No feedback and not enough information.

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue May 06 19:01:28 2025 UTC