Count how many variables have an underscore inside
grep -E -r --include=*.php "[$][a-zA-Z\x7f-\xff]([a-zA-Z0-9\x7f-\xff]*_[a-zA-Z0-9\x7f-\xff]*)+" . | wc -l
Count how many variables have no underscore inside
grep -E -r --include=*.php "[$][a-zA-Z\x7f-\xff][a-zA-Z0-9\x7f-\xff]*" . | wc -l
The regex is from : http://php.net/manual/en/language.variables.basics.php