Open php4fan opened 2 years ago
Looks like a leftover: I don't see it requiring a string, just a generic array/object/stringable value.
But I do see that it accepts any array/object/stringable value for that handler, meaning it hasn't switched to more modern support that only allows valid callbacks. https://3v4l.org/0kBnZ
I'm going to look into the C code to improve it and will handle the docs at the same time.
Similarly, xml_set_element_handler etc say stuff like "The function named by
From manual page: https://php.net/function.xml-set-default-handler
It says:
Ok so
$handler
is a callable. We all know what a callable is: either a string which is the name of a function, an[$object, 'methodName']
pair, or an anonymous function definition.But then it says:
Wait, so must it be a string? Or is this just a leftover from an older version when callables didn't exist and it actually had to be a string with a function name?