I have a regex for finding all function definitions. What I want to do now is to get also the contents in the functions e.g. as third field in $matches
is that possible using regex or do I need some push-pop machine because of the nesting of {}
brackets?
What I want to do is a script which analyzes php code and figures out which functions have dependencies. If there is already a script let me know it!
$content = file_get_contents($fileName);
preg_match_all("/(function )(\w+\(.*?\))/", $content, $matches);
I don't want to use php-tokenizer because it figures out also some "hidden-functions" like predefined functions and that stuff, but I want just the functions written in code.