Re: Interface inheritance

From: Date: Tue, 20 Apr 2004 16:20:11 +0000
Subject: Re: Interface inheritance
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-9430@lists.php.net to get a copy of this message
On Apr 20, 2004, at 11:39 AM, Ferdinand Beyer wrote:
On 20 Apr 2004 at 11:22, George Schlossnagle wrote:
PHP doesn't support this, regardless of you being able to tell them apart, scalar types in PHP are isomorphic.
Yes, I know. This is why I am against strict parameter checking.
Everything works fine if you except that 'scalar' is a base type and that int, string, etc. are not.
Provided that one has access to the interfaces...
I must not understand this comment. How can you implement an
interface
you don't have knowledge of?
I meant in some cases you cannot change the underlying interface or base class. Classes in third-party libraries or internal classes, for example.
If you need to change the interface then you shouldnt be implementing it.
The fact is that since PHP doesn't support parameter based
method
dispatching, you _can't_ implement both A and B, since you can
not
comply with both signature contracts simultaneously.
IMO I should, using variable arguments. This is currently impossible.
Then you aren't implementing the interface. The interface is a contract, you can't enforce it with variable arguments. George

« previous php.internals (#9430) next »