I'm using PHP 7.2.10
I am using a built-in PHP function htmlspecialchars()
Following is my code :
<?php
$new = htmlspecialchars("<a href='test'>Test</a>", ENT_QUOTES);
echo $new;
?>
I want to pass all the parameters(arguments) of the function htmlspecialchars()
in above code. The expected parameter list should include all the parameters including the invisible parameters(i.e. default parameters) with their respective values as mentioned here
Thank You.
In short: no.
ReflectionFunction::getParameters
and ReflectionParameter::getDefaultValue
should theoretically help here, but they don't work for built-in functions.
var_dump(array_map(function ($p) { return $p->getDefaultValue(); },
(new ReflectionFunction('htmlspecialchars'))->getParameters()));
So, no. Read the manual, see what the default values are, and hardcode them in your code. Or just don't pass them at all, since that's pointless.