note 96531 added to language.oop5.magic
| From: | frost at aeonity dot com | Date: | Wed, 03 Mar 2010 18:20:36 +0000 |
| Subject: | note 96531 added to language.oop5.magic | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-166591@lists.php.net to get a copy of this message | ||
jahanaddison6, I am not sure what you are expecting here, but because the construct returns false
(which constructors should not return anything and hence it is just ignored) does not mean that the
object will not be instantiated.
So this does infact work as expected, perhaps you need to read more on Constructors.
//START QUOTE//
jahanaddison6 at hotmail dot com
03-May-2009 10:16
If you're expecting this code to work think again:
<?php
class Example
{
public function __construct()
{
return false;
}
public function Test()
{
return true;
}
}
?>
The above code will not work as expected, The Test method will still return true.
//END QUOTE//
----
Server IP: 69.147.83.197
Probable Submitter: 4.227.249.151
----
Manual Page -- http://www.php.net/manual/en/language.oop5.magic.php
Edit -- https://master.php.net/note/edit/96531
Del: integrated -- https://master.php.net/note/delete/96531/integrated
Del: useless -- https://master.php.net/note/delete/96531/useless
Del: bad code -- https://master.php.net/note/delete/96531/bad+code
Del: spam -- https://master.php.net/note/delete/96531/spam
Del: non-english -- https://master.php.net/note/delete/96531/non-english
Del: in docs -- https://master.php.net/note/delete/96531/in+docs
Del: other reasons-- https://master.php.net/note/delete/96531
Reject -- https://master.php.net/note/reject/96531
Search -- https://master.php.net/manage/user-notes.php