I have a file which consist of user defined functions with CamelCase names :
// some useful comments
function functionOne(){
return false;
}
// some other useful comment
function addTwoNumbers($x,$y)
{
return 5;
}
...
I would like to output these functions sorted by name like
addTwoNumbers($x,$y)
2 parameters
Comment: some other useful comment
functionOne()
0 parameters
Comment: some useful comments
So far, I get a list of function names like this:
include '../includes/functions.php';
$allFunctions = get_defined_functions();
$userFunctions = $allFunctions['user'];
sort($userFunctions);
foreach ($userFunctions as $functionName) {
echo $functionName. "<br>";
}
My main problem is that I do not know how to display the number of parameters of each function and the parameter variable names.
Further (but I could live with it) the function names are only displayed with lower case letters, so I can't read them in CamelCase.
And finally the comments are of course not shown. I was thinking of writing them in an array $comments['functionOne']="some useful comments".
So my main problem is how do you get the parameter variable names and number.