PHP 4.0 Bug #9253 Updated: Class constructors can't return values

From: Date: Wed, 14 Feb 2001 14:44:53 +0000
Subject: PHP 4.0 Bug #9253 Updated: Class constructors can't return values
Groups: php.dev 
Request: Send a blank email to php-dev+get-46566@lists.php.net to get a copy of this message
ID: 9253 Updated by: andre Reported By: stefan.p@noos.fr Old-Status: Open Status: Bogus Bug Type: Feature/Change Request Assigned To: Comments: class constructors are never supposed to return anything, they are simple the fist method called after an object has <hack> anyway if you *really* want to return false just kill the object itself from within the constructor (to be sure take the last line) using unset($this) or $this=FALSE or $this=NULL </hack> bogusifying Previous Comments: --------------------------------------------------------------------------- [2001-02-14 05:23:05] stefan.p@noos.fr Class constructors can't abort instance creation, for example by returning false... This leads to a lot of "if (! $newobj->status)" crap. Why is that ? I found a message on the PHP3 mailing list about this, but it's still not there. --------------------------------------------------------------------------- ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=9253&edit=2

« previous php.dev (#46566) next »