Am 23.08.2016 um 14:51 schrieb Julien Pauli: > On Tue, Aug 23, 2016 at 1:51 PM, Christoph M. Becker <cmbecke...@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 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php