Re: Bug #13028 Updated: bug with empty Class Constructors

From: Date: Thu, 30 Aug 2001 13:02:17 +0000
Subject: Re: Bug #13028 Updated: bug with empty Class Constructors
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-64704@lists.php.net to get a copy of this message
The class will become instanciated but if you try to call a method from it PHP says you are calling a method of an undefined class ----- Original Message ----- From: "Bug Database" <php-dev@lists.php.net> To: <40334233@gmx.net> Sent: Thursday, August 30, 2001 2:49 PM Subject: Bug #13028 Updated: bug with empty Class Constructors > ID: 13028 > Updated by: dbeu > Reported By: 40334233@gmx.net > Old Status: Open > Status: Feedback > Bug Type: Scripting Engine problem > Operating System: Win2000 > PHP Version: 4.0.6 > New Comment: > > be a bit more precise... > what do you mean with "have had problems instanciating classes" and "the class does not become properly instanciated" ? > > Previous Comments: > ------------------------------------------------------------------------ > > [2001-08-29 09:12:26] 40334233@gmx.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 > > } > > ------------------------------------------------------------------------ > > > > ATTENTION! Do NOT reply to this email! > To reply, use the web interface found at http://bugs.php.net/?id=13028&edit=2 >

« previous php.dev (#64704) next »