PHP 4.0 Bug #8935 Updated: A reference to 'this' can not be used in the constructor method for a class.

From: Date: Tue, 13 Mar 2001 10:00:14 +0000
Subject: PHP 4.0 Bug #8935 Updated: A reference to 'this' can not be used in the constructor method for a class.
Groups: php.dev 
Request: Send a blank email to php-dev+get-48794@lists.php.net to get a copy of this message
ID: 8935 User Update by: johanp@aditus.nu Status: Closed Bug Type: Class/Object related Description: A reference to 'this' can not be used in the constructor method for a class. I haven't tried the $a = & new syntax However, is that really a working solution? This would require all clients of that class to actually have to know that the constructor would like to use a &$this reference and hence the clients must know about the specific implementation. Is that such a good idea? Wouldn't it be better to allow the use of &$this in a constructor as default without having to create the class with this special version of new(). or did I mmiss something here? Previous Comments: --------------------------------------------------------------------------- [2001-03-09 18:24:38] andre@php.net I have added some notes to the documenation, as far as the the site has been updated its documenatation check it out "language.oop.newref.html" (http://snaps.php.net/manuals/) it may take a day or two ... --------------------------------------------------------------------------- [2001-03-09 17:26:53] andre@php.net not really this is only a duplicate report for an already fixed bug... --------------------------------------------------------------------------- [2001-03-09 17:09:08] sniper@php.net It's fixed -> closed. --Jani --------------------------------------------------------------------------- [2001-03-09 13:50:45] andre@php.net this has been fixed for months, please use =& new instead of = new in this special case --------------------------------------------------------------------------- [2001-02-24 14:14:09] jmoore@php.net Please see the 4.0.4 release change log a lot of things along this line were fixed. James --------------------------------------------------------------------------- The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online. Full Bug description available at: http://bugs.php.net/?id=8935

« previous php.dev (#48794) next »