Re: BC break: ReflectionMethod::invoke() expects parameter1 to be object, string given

From: Date: Mon, 22 Aug 2016 16:34:20 +0000
Subject: Re: BC break: ReflectionMethod::invoke() expects parameter1 to be object, string given
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-95386@lists.php.net to get a copy of this message
On Mon, Aug 22, 2016 at 6:30 PM, Christoph M. Becker <cmbecker69@gmx.de> wrote: > On 22.08.2016 at 18:00, Julien Pauli wrote: > >> I agree this is a BC break and should not stay as-is in source code. > > I wonder why we have more than 100 lines of "Backward incompatible > changes" in the PHP 7.1.0beta3 changelog[1], if BC breaks shouldn't be > introduced in a minor release. > >> It makes some testsuites fail, that did not fail before ; thus it breaks things. > > An estimated 10% (at least) of my *bugfixes* in GD broke at least one > PHPT, because the test was broken in the first place. > >> I think @Alexander is right. >> We should allow passing a string, and perform some Late Static Binding >> through it. >> That would solve the BC Break problem as well as extend the feature in >> a more PHP-friendly way. > > Are you sure that would solve the BC break? As it were, one could pass > an arbitrary string. I can easily imagine that some refactoring > introduced a new class in a hierarchy, but nobody noticed that an > ::invoke() call would have to be adjusted accordingly. Suddenly > changing the meaning of the first parameter may well introduce a > behavioral change. Well, we must find a solution that tries to cope with everyone needs, and tries to make PHP more consistent if possible. I know it is not an easy topic , but I'm sure we'll find some consensus. I'll prepare a patch exposing my ideas soon. Julien

« previous php.internals (#95386) next »