problem with interfaces
| From: | Cristiano Duarte | Date: | Sun, 31 Aug 2003 15:56:10 +0000 |
| Subject: | problem with interfaces | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-4321@lists.php.net to get a copy of this message | ||
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