In PHP5 I noticed this behaviou with interfaces. If I have an interface
with a method that takes no paramaters, an implementing class for that
interfaces can have the same method take parameters...is that right?
For example:
interface foo {
public function myFunction();
}
class foobar implements foo {
public function myFunction($someText)
{
echo $someText;
}
}
$myObj = new foobar();
$myObj->myFunction('Testing, 1, 2, 3');
This code works. To me it should flag an error or, at least a warning,
no? I can see the flexibility of allowing this as it provides a kind-of
form of overloading but I want to make sure this behaves as intended
before I make use of this feature/bug.
--Tony
At 22:39 11/07/2003, Tony Bibbs wrote:
In PHP5 I noticed this behaviou with interfaces. If I have an interface
with a method that takes no paramaters, an implementing class for that
interfaces can have the same method take parameters...is that right?
For example:interface foo {
public function myFunction();
}class foobar implements foo {
public function myFunction($someText)
{
echo $someText;
}
}$myObj = new foobar();
$myObj->myFunction('Testing, 1, 2, 3');This code works. To me it should flag an error or, at least a warning, no?
Yep, it should error out, it's a bug. I'll look into it.
Zeev
This bug should be gone now...
Thanks for the report!
Zeev
At 22:39 11/07/2003, Tony Bibbs wrote:
In PHP5 I noticed this behaviou with interfaces. If I have an interface
with a method that takes no paramaters, an implementing class for that
interfaces can have the same method take parameters...is that right?
For example:interface foo {
public function myFunction();
}class foobar implements foo {
public function myFunction($someText)
{
echo $someText;
}
}$myObj = new foobar();
$myObj->myFunction('Testing, 1, 2, 3');This code works. To me it should flag an error or, at least a warning,
no? I can see the flexibility of allowing this as it provides a kind-of
form of overloading but I want to make sure this behaves as intended
before I make use of this feature/bug.--Tony