note 21067 added to language.oop.constructor

From: Date: Sat, 27 Apr 2002 08:28:30 +0000
Subject: note 21067 added to language.oop.constructor
Groups: php.notes 
Request: Send a blank email to php-notes+get-29909@lists.php.net to get a copy of this message
Can you validate the construction process? I'm creating a "Folder" class. The constructor should check if the path passed to him is valid, and if not he should refuse to create that instance of the class. I'm returning "false" right now from the constructor when the correctness is not met, but I'm not very sure who receives this result. If I do: $F = new Folder($path); $F has the result of a return in Folder($path)? And what if for some (maybe stupid) reason I retun something more than "false"? $F ends being the object I want or the value passed by the constructor's return? -- http://www.php.net/manual/en/language.oop.constructor.php http://master.php.net/manage/user-notes.php?action=edit+21067 http://master.php.net/manage/user-notes.php?action=delete+21067 http://master.php.net/manage/user-notes.php?action=reject+21067

« previous php.notes (#29909) next »