On Wed, Jul 30, 2014 at 3:54 PM, Matteo Beccati <p...@beccati.com> wrote:

> Hi Bob,
>
> On 30/07/2014 14:33, Bob Weinand wrote:
> > Is this a problem if the interface internally doesn't expect a parameter?
> >
> > You're free to expect the parameter or not, where's  the issue?
> > We allow implementations to accept more optional parameters than the
> > interface specifies, but not less.
>
> Yes, precisely. If something is using an Interface it should *not* add
> unspecified parameters to the method calls, as the implementation might
> have added some of their own with a different meaning.
>
> > So, it seems optimal to me, to make the interface specify no parameters,
> > then the class implementing this interface is free to accept either no
> > parameter (= don't care about recursive) or one optional one.
>
> So, PHP specifies a Countable interface, and its count() method has no
> parameters. However, if you check the documentation then you'll find out
> that in fact it might be sent one. On some occasions.
>
> > I'll though happily apply your patch now.
>
> I wrote it, but to be honest now I think it's just hiding the problem
> under the carpet.
>
>
> Cheers
> --
> Matteo Beccati
>
> Development & Consulting - http://www.beccati.com/
>

for the record here is a code snippet showing the BC break:
http://3v4l.org/4O9nA
and as far as I Can understand, even with Matteo's patch, the output would
be still different(1,1,0,0)

-- 
Ferenc Kovács
@Tyr43l - http://tyrael.hu

Reply via email to