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

Add a Patch

Pull Requests

Add a Pull Request

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