Re: problem with interfaces
| From: | Cristiano Duarte | Date: | Mon, 08 Sep 2003 23:51:33 +0000 |
| Subject: | Re: problem with interfaces | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-4438@lists.php.net to get a copy of this message | ||
Did anyone think about it ? Any opinions ?
Cristiano Duarte.
"Cristiano Duarte" <cunha17@uol.com.br> escreveu na mensagem
news:20030831155609.91744.qmail@pb1.pair.com...
> Hi all,
>
> Is this supposed to work?
>
> interface test {
> function my_function ($mandatory_parameter);
> }
>
> class test_class implements test {
> function my_function ($mandatory_parameter, $optional_parameter =
null)
> {
> }
> }
>
> The test_class class implements correctly the 'test' interface since PHP
> does not allow multiple explicit method declarations (explicit
overloading).
>
> IMHO, if all additional parameters are optional, the interface commitment
is
> preserved.
>
> Cristiano Duarte