Why are interfaces unusable in PHP?
- by streetparade
I mean an interface definition without defining the return type makes it unusable?
This makes more Clear
Interface run
{
public function getInteger();
}
class MyString implements run
{
public function myNumber()
{
}
public function getInteger()
{
return "Not a number";
}
}
In Java every Interface has a return type like Integer,String,Void
I know that PHP is unfortunately a loosly typed Language but isnt there a Solution for that Problem?
Is it Possible to defining a Interface with a Return type like Integer?