note 73058 deleted from language.oop5.typehinting by cmb
| From: | cmb@php.net | Date: | Sat, 10 Dec 2016 11:52:59 +0000 |
| Subject: | note 73058 deleted from language.oop5.typehinting by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-208445@lists.php.net to get a copy of this message | ||
Note Submitter: Edorian
----
In response to nicholas at nicholaswilliams dot info:
Of course this doesn't work. Not in Php nor in Java.
You can't put a Chair into Table just because there both implementing "Object"
It wouldn't make any sense to say "i'm expecting an argument that implements the same
object that i'm implementing" with type hinting.
You say: "I'm expection an Object of that Class or a Object of a Subclass of that Class
" like you do in every OO languange.