Created
December 13, 2017 21:13
-
-
Save gauthierm/86363b4c3b8433429ea328e1bb4e0702 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$functions = [ | |
'mail', | |
'strlen', | |
'strpos', | |
'strrpos', | |
'substr', | |
'strtolower', | |
'strtoupper', | |
'stripos', | |
'strripos', | |
'strstr', | |
'stristr', | |
'strrchr', | |
'substr_count', | |
]; | |
foreach ($functions as $function) { | |
$expression = '[^A-Za-z0-9_]' . $function . '\('; | |
$matches = `ack -cl '$expression'`; | |
$lines = explode("\n", $matches); | |
$total = 0; | |
foreach ($lines as $line) { | |
$parts = explode(':', $line); | |
$count = intval(end($parts)); | |
$total += $count; | |
} | |
echo str_pad($function, 12) . ' : ' . $total . "\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment