note 12009 added to language.oop.php

From: Date: Sun, 18 Mar 2001 05:33:38 +0000
Subject: note 12009 added to language.oop.php
Groups: php.notes 
Request: Send a blank email to php-notes+get-12520@lists.php.net to get a copy of this message
I wondered why the "new" assignments in these examples were never tested for success --- ie. if(!($var = new Cart())) echo "failure"; Now I know (at least for PHP4.0.4pl1). The test ALWAYS fails unless the constructor of the class does a local member variable assignment. This I don't like. Could someone please explain to me why this is a "good thing"? http://www.php.net/manual/en/language.oop.php

« previous php.notes (#12520) next »