I am building a documentation page for a PHP library. I started with retrieving an array of defined functions from a PHP file, and it's working brilliantly inside of a directory traversing loop.
Now i'm trying to retrieve the arguments that are defined in that function. In this example...
function askQuestion(&$person, $question) {
if(!$person['nice']){
return false;
}
else {
return 'Go to college';
}
}
I would want to retrieve either this string: &$person, $question
or an array of each argument somehow? Preferably, i'd want to know if it is a variable by reference like &$person
.
I found the func_get_arg(s) documentation but, from what I understand, it's meant to retrieve the arguments of the function that you are calling func_get_args()
from, and not the actual argument variable names. As far as research goes, i'm not fundamental enough with PHP yet to know what jargon I should be using to find this answer online. Any ideas?