Re: BC break: ReflectionMethod::invoke() expects parameter1 to be object, string given
| From: | Rowan Collins | Date: | Mon, 22 Aug 2016 15:44:16 +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-95382@lists.php.net to get a copy of this message | ||
On 22/08/2016 16:40, Christoph M. Becker wrote:
OK, so that's a further inconsistency. The current version still doesn't actually make sense, though. If you want to validate that the correct argument is being passed, then the only value allowed should be null.It is still ignored if it is a valid object, so the current beta'sbehaviour doesn't actually make a lot of sense. Well, see <https://3v4l.org/n8cad>. Only as of 7.1.0beta3 ::invoke() matches the behavior of ::invokeArgs().
If so desired, I can revert that commit, but I wouldn't be happy with sticking with a completely unused parameter, which obviously has been and still is misunderstood.The parameter is still unused, and can be any object. The only sane validation would be to check explicitly for null, which is documented as the correct argument for both invoke() and invokeArgs(). Regards, -- Rowan Collins [IMSoP]