Skip to content

Instantly share code, notes, and snippets.

@wizardishungry
Created June 13, 2011 17:46
Show Gist options
  • Save wizardishungry/1023290 to your computer and use it in GitHub Desktop.
Save wizardishungry/1023290 to your computer and use it in GitHub Desktop.
Shell expression for finding functions inside a (non-OO) php file and grepping for their names
grep 'function\W\w*\W*(' foo.php | cut -d \( -f 1 | grep -v // | sed 's/^\W*//' | cut -d ' ' -f 2- | sed 's/.*/echo -n &: \&\& egrep -r "&.?[(]" ..\/* | grep -v -- \"->&\" | grep -v ..\/functions\/ | wc -l /' | sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment