If your coding style guarantees that you'll never break the arguments of a function declaration over multiple lines, you can hack a prototype generator pretty easily by selecting lines that match the following patterns (and correcting the braces as needed):
/^class /
/^}/
/^\s*(\w+)?\s*function\b/ # Must append a closing } to each line matching this
You could rig a PHP script to do all this, but if you've got the Unix tools in your environment, the above is a few characters away from being a complete sed script.
Here it is embedded in a PHP script, as requested (not tested):
$fp = fopen("source.php");
while (($line = fgets($fp)) !== false) {
if (preg_match("/^class |^}/", $line))
print $line;
elif (preg_match('/^\s*(\w+)?\s*function\b/', $line))
print rtrim($line) . " }
";
}
Adapt/extend as needed for your coding style.