Even if for better or worse you're not Noam Chomsky, you should understand this:
PHP is not a regular language, so cannot be expressed or parsed by regular expressions.
To be a regular language, a language needs to be, among other things, context free.
"Context free" means that a "word" in the language means the same thing regardless of where it occurs. This is not the case for PHP. In fact, even your simple snippet to find function signatures already crashes and burns here:
// function foo()
The context of a comment voids this function
keyword of its usual meaning. Not to mention:
'function foo()';
<<<HERE
function foo()
HERE;
and a host of similar examples. The function
keyword (and everything else too) is dependent on context, making PHP a context-sensitive language, thereby not regular, thereby not feasibly parseable by regular expressions.
Use a parser.