Is it possible to get the number of arguments expected from an anonymous function in PHP? I know ReflectMethod, but this only works if the method is defined in the class. In my case, an anonymous function will either have one or two arguments. I would prefer to do the check correctly, instead of wrapping the first call in try / catch and retrying with two parameters if the first fails.
source
share