note 94034 added to language.oop5.abstract
| From: | pete at surfaceeffect dot com | Date: | Tue, 13 Oct 2009 09:49:34 +0000 |
| Subject: | note 94034 added to language.oop5.abstract | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-161671@lists.php.net to get a copy of this message | ||
One fairly important difference between php's abstract functions and, say, Java, is that php
does not specify the return type in any way - or indeed whether there has to be one.
public abstract function square($number);
could be implemented by...
public function square($number) {
return $number*$number;
}
or
public function square($number) {
print ($number*$number);
}
So you need to take care that incompatibilities don't arise due to not returning the right kind
of value and this is not enforced in any way.
----
Server IP: 69.147.83.197
Probable Submitter: 213.78.144.116
----
Manual Page -- http://www.php.net/manual/en/language.oop5.abstract.php
Edit -- https://master.php.net/note/edit/94034
Del: integrated -- https://master.php.net/note/delete/94034/integrated
Del: useless -- https://master.php.net/note/delete/94034/useless
Del: bad code -- https://master.php.net/note/delete/94034/bad+code
Del: spam -- https://master.php.net/note/delete/94034/spam
Del: non-english -- https://master.php.net/note/delete/94034/non-english
Del: in docs -- https://master.php.net/note/delete/94034/in+docs
Del: other reasons-- https://master.php.net/note/delete/94034
Reject -- https://master.php.net/note/reject/94034
Search -- https://master.php.net/manage/user-notes.php