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

From: Date: Mon, 22 Aug 2016 16:30:24 +0000
Subject: Re: BC break: ReflectionMethod::invoke() expects parameter1 to be object, string given
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-95385@lists.php.net to get a copy of this message
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. [1] <https://github.com/php/php-src/blob/PHP-7.1.0beta3/UPGRADING#L18-L129> -- Christoph M. Becker

« previous php.internals (#95385) next »