- array_map: documentation ( source)
- get_defined_functions: documentation ( source)
- array_count_values: documentation ( source)
- ksort: documentation ( source)
<?php
$internal_functions = get_defined_functions()['internal'];
$lengths = array_map(
function ($name) {
return strlen($name);
},
$internal_functions
);
$length_variance = array_count_values($lengths);
ksort($length_variance);
echo 'Total Function Count: '. count($length_variance) . PHP_EOL . PHP_EOL;
foreach ($length_variance as $length => $count) {
echo 'Name Length: '. $length;
echo "\t\t Count:". $count;
echo PHP_EOL;
}