note 115646 added to language.oop5.interfaces
| From: | marcoshoya at gmail dot com | Date: | Sun, 31 Aug 2014 20:48:05 +0000 |
| Subject: | note 115646 added to language.oop5.interfaces | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-200351@lists.php.net to get a copy of this message | ||
You can change some methods signature from interface if you pass parameters with default values. For
instance:
<?php
interface Foo {
public function foo($foo);
}
class Bar implements Foo {
public function foo($foo, $bar = null) {
return $foo . $bar;
}
}
$bar = new Bar();
// output: worksfine
echo $bar->foo('works', 'fine');
----
Server IP: 72.52.91.14
Probable Submitter: 177.92.47.20
----
Manual Page -- http://php.net/manual/en/language.oop5.interfaces.php
Edit -- https://master.php.net/note/edit/115646
Del: integrated -- https://master.php.net/note/delete/115646/integrated
Del: useless -- https://master.php.net/note/delete/115646/useless
Del: bad code -- https://master.php.net/note/delete/115646/bad+code
Del: spam -- https://master.php.net/note/delete/115646/spam
Del: non-english -- https://master.php.net/note/delete/115646/non-english
Del: in docs -- https://master.php.net/note/delete/115646/in+docs
Del: other reasons-- https://master.php.net/note/delete/115646
Reject -- https://master.php.net/note/reject/115646
Search -- https://master.php.net/manage/user-notes.php