Re: BC break: ReflectionMethod::invoke() expectsparameter1to be object, string given
| From: | Christoph M. Becker | Date: | Thu, 25 Aug 2016 12:44:12 +0000 |
| Subject: | Re: BC break: ReflectionMethod::invoke() expectsparameter1to be object, string given | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-95447@lists.php.net to get a copy of this message | ||
Am 23.08.2016 um 14:51 schrieb Julien Pauli:
> On Tue, Aug 23, 2016 at 1:51 PM, Christoph M. Becker <cmbecker69@gmx.de> wrote:
>
>> I suggest to deprecate all other types than NULL as first arg for static
>> methods, because passing an int, for instance, makes even less sense as
>> Rowan has already pointed out elsewhere in this thread.
>
> What about passing nothing ?
>
> $reflectionMeth->invoke();
>
> Actually, this is not possible and a Warning:
> ReflectionMethod::invoke() expects at least 1 parameter, 0 given in %s
> on line %d is thrown.
> Should we keep that behavior as well ? Knowing that passing nothing,
> the function will get an IS_NULL zval.
I don't think it's good to introduce this shortcut, which is of limited
value anyway. It might be better to have something like
::invokeStatic() which wouldn't require passing a NULL as first parameter.
--
Christoph M. Becker