Skip to content

Instantly share code, notes, and snippets.

@pramodjodhani
Created February 13, 2020 18:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pramodjodhani/32ca7c194b02ec548f71ba5df1e45b29 to your computer and use it in GitHub Desktop.
Save pramodjodhani/32ca7c194b02ec548f71ba5df1e45b29 to your computer and use it in GitHub Desktop.
List all the functions in current directory
<?php
$functions = [];
foreach( glob("./{,*/,*/*/,*/*/*/}*.php" , GLOB_BRACE ) as $file ) {
$matches = [];
$content = file_get_contents( $file );
preg_match_all( "/function\s(.*)\(/", $content, $matches );
$functions = array_merge( $matches[1] , $functions );
}
print_r( $functions );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment