note 74945 added to language.oop5.overloading
| From: | BenBE at omorphia dot de | Date: | Sat, 05 May 2007 17:48:42 +0000 |
| Subject: | note 74945 added to language.oop5.overloading | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-126217@lists.php.net to get a copy of this message | ||
While playing a bit with the __call magic method I found you can not emulate implementing methods of
an interface as you might think:
<?
class Iteratable implements Iterator {
public function __call($funcname) {
if(in_array($funcname, array('current', 'next', /*...*/)) {
//Redirect the call or perform the actual action
}
}
}
?>
Using this code you'll get a "class Iteratable contains abstract methods ..." fatal
error message. You'll ALWAYS have to implement those routines by hand.
----
Server IP: 212.124.37.9
Probable Submitter: 217.93.220.184
----
Manual Page -- http://www.php.net/manual/en/language.oop5.overloading.php
Edit -- https://master.php.net/note/edit/74945
Del: integrated -- https://master.php.net/note/delete/74945/integrated
Del: useless -- https://master.php.net/note/delete/74945/useless
Del: bad code -- https://master.php.net/note/delete/74945/bad+code
Del: spam -- https://master.php.net/note/delete/74945/spam
Del: non-english -- https://master.php.net/note/delete/74945/non-english
Del: in docs -- https://master.php.net/note/delete/74945/in+docs
Del: other reasons-- https://master.php.net/note/delete/74945
Reject -- https://master.php.net/note/reject/74945
Search -- https://master.php.net/manage/user-notes.php