This is a list of the 100 most common built-in PHP functions, and the 100 most common Drupal functions in the Drupal source code. Language constructs and reserved words are excluded from the count (foreach, for, while, list, isset, etc).
Total Built-in Functions Used: 239
Total Built-in Function calls in Drupal source code: 1392.
| Rank |
Function |
Occurrences |
Per Cent |
| 1 |
define |
94 |
6.75 |
| 2 |
implode |
79 |
5.68 |
| 3 |
array_merge |
63 |
4.53 |
| 4 |
substr |
58 |
4.17 |
| 5 |
trim |
38 |
2.73 |
| 6 |
str_replace |
38 |
2.73 |
| 7 |
count |
37 |
2.66 |
| 8 |
preg_replace |
35 |
2.51 |
| 9 |
array_pop |
33 |
2.37 |
| 10 |
array_shift |
31 |
2.23 |
| 11 |
explode |
30 |
2.16 |
| 12 |
ini_set |
29 |
2.08 |
| 13 |
header |
27 |
1.94 |
| 14 |
urldecode |
23 |
1.65 |
| 15 |
call_user_func_array |
22 |
1.58 |
| 16 |
func_get_args |
21 |
1.51 |
| 17 |
chr |
17 |
1.22 |
| 18 |
array_keys |
16 |
1.15 |
| 19 |
array_unshift |
15 |
1.08 |
| 20 |
preg_match |
15 |
1.08 |
| 21 |
preg_replace_callback |
15 |
1.08 |
| 22 |
in_array |
15 |
1.08 |
| 23 |
is_array |
14 |
1.01 |
| 24 |
strtr |
14 |
1.01 |
| 25 |
array_filter |
13 |
0.93 |
| 26 |
strpos |
12 |
0.86 |
| 27 |
md5 |
12 |
0.86 |
| 28 |
parse_url |
12 |
0.86 |
| 29 |
dirname |
11 |
0.79 |
| 30 |
unserialize |
11 |
0.79 |
| 31 |
max |
11 |
0.79 |
| 32 |
gmdate |
10 |
0.72 |
| 33 |
strlen |
9 |
0.65 |
| 34 |
printf |
9 |
0.65 |
| 35 |
time |
9 |
0.65 |
| 36 |
pg_query |
9 |
0.65 |
| 37 |
serialize |
8 |
0.57 |
| 38 |
round |
8 |
0.57 |
| 39 |
array_walk |
8 |
0.57 |
| 40 |
array_flip |
8 |
0.57 |
| 41 |
date |
8 |
0.57 |
| 42 |
array_unique |
8 |
0.57 |
| 43 |
ksort |
8 |
0.57 |
| 44 |
str_repeat |
7 |
0.50 |
| 45 |
mysqli_query |
7 |
0.50 |
| 46 |
array_map |
7 |
0.50 |
| 47 |
asort |
7 |
0.50 |
| 48 |
mysql_query |
7 |
0.50 |
| 49 |
file_get_contents |
6 |
0.43 |
| 50 |
function_exists |
6 |
0.43 |
| 51 |
register_shutdown_function |
6 |
0.43 |
| 52 |
array_reverse |
6 |
0.43 |
| 53 |
ceil |
5 |
0.36 |
| 54 |
fclose |
5 |
0.36 |
| 55 |
urlencode |
5 |
0.36 |
| 56 |
xml_parser_create |
5 |
0.36 |
| 57 |
uasort |
5 |
0.36 |
| 58 |
file |
5 |
0.36 |
| 59 |
strstr |
5 |
0.36 |
| 60 |
basename |
5 |
0.36 |
| 61 |
base64_encode |
5 |
0.36 |
| 62 |
bcmod |
5 |
0.36 |
| 63 |
min |
5 |
0.36 |
| 64 |
strtolower |
5 |
0.36 |
| 65 |
floor |
4 |
0.29 |
| 66 |
array_merge_recursive |
4 |
0.29 |
| 67 |
array_slice |
4 |
0.29 |
| 68 |
preg_match_all |
4 |
0.29 |
| 69 |
ob_start |
4 |
0.29 |
| 70 |
mysql_connect |
4 |
0.29 |
| 71 |
abs |
4 |
0.29 |
| 72 |
realpath |
4 |
0.29 |
| 73 |
ltrim |
4 |
0.29 |
| 74 |
mail |
4 |
0.29 |
| 75 |
preg_split |
4 |
0.29 |
| 76 |
base64_decode |
4 |
0.29 |
| 77 |
chmod |
4 |
0.29 |
| 78 |
array_key_exists |
4 |
0.29 |
| 79 |
call_user_func |
4 |
0.29 |
| 80 |
ob_end_clean |
4 |
0.29 |
| 81 |
ord |
4 |
0.29 |
| 82 |
array_values |
3 |
0.22 |
| 83 |
is_numeric |
3 |
0.22 |
| 84 |
xml_parser_free |
3 |
0.22 |
| 85 |
debug_backtrace |
3 |
0.22 |
| 86 |
pg_last_error |
3 |
0.22 |
| 87 |
is_dir |
3 |
0.22 |
| 88 |
intval |
3 |
0.22 |
| 89 |
xml_set_character_data_handler |
3 |
0.22 |
| 90 |
is_string |
3 |
0.22 |
| 91 |
stripslashes |
3 |
0.22 |
| 92 |
sort |
3 |
0.22 |
| 93 |
fopen |
3 |
0.22 |
| 94 |
ini_get |
3 |
0.22 |
| 95 |
xml_set_element_handler |
3 |
0.22 |
| 96 |
trigger_error |
3 |
0.22 |
| 97 |
extract |
3 |
0.22 |
| 98 |
is_object |
3 |
0.22 |
| 99 |
array_diff |
3 |
0.22 |
| 100 |
link |
3 |
0.22 |
Total Drupal Functions Used: 1647
Total Custom Drupal Function calls in Drupal source code: 6819.
| Rank |
Function |
Occurrences |
Per Cent |
| 1 |
t |
1133 |
16.62 |
| 2 |
theme |
273 |
4.00 |
| 3 |
db_query |
230 |
3.37 |
| 4 |
drupal_set_message |
214 |
3.14 |
| 5 |
variable_get |
148 |
2.17 |
| 6 |
drupal_render |
113 |
1.66 |
| 7 |
form_set_error |
89 |
1.31 |
| 8 |
check_plain |
80 |
1.17 |
| 9 |
watchdog |
78 |
1.14 |
| 10 |
l |
73 |
1.07 |
| 11 |
st |
68 |
1.00 |
| 12 |
drupal_set_title |
66 |
0.97 |
| 13 |
drupal_get_form |
59 |
0.87 |
| 14 |
variable_set |
52 |
0.76 |
| 15 |
system_settings_form |
43 |
0.63 |
| 16 |
cache_clear_all |
43 |
0.63 |
| 17 |
update_sql |
40 |
0.59 |
| 18 |
drupal_goto |
39 |
0.57 |
| 19 |
drupal_add_js |
38 |
0.56 |
| 20 |
db_result |
34 |
0.50 |
| 21 |
url |
34 |
0.50 |
| 22 |
theme_get_setting |
33 |
0.48 |
| 23 |
confirm_form |
32 |
0.47 |
| 24 |
base_path |
27 |
0.40 |
| 25 |
pager_query |
27 |
0.40 |
| 26 |
drupal_add_css |
27 |
0.40 |
| 27 |
module_invoke |
27 |
0.40 |
| 28 |
format_date |
26 |
0.38 |
| 29 |
check_url |
26 |
0.38 |
| 30 |
drupal_not_found |
25 |
0.37 |
| 31 |
db_fetch_object |
25 |
0.37 |
| 32 |
module_invoke_all |
22 |
0.32 |
| 33 |
drupal_attributes |
19 |
0.28 |
| 34 |
drupal_alter |
19 |
0.28 |
| 35 |
drupal_map_assoc |
19 |
0.28 |
| 36 |
db_query_range |
18 |
0.26 |
| 37 |
language_list |
17 |
0.25 |
| 38 |
get_t |
17 |
0.25 |
| 39 |
drupal_add_tabledrag |
17 |
0.25 |
| 40 |
xmlrpc_error |
17 |
0.25 |
| 41 |
language_default |
16 |
0.23 |
| 42 |
arg |
16 |
0.23 |
| 43 |
template_preprocess |
16 |
0.23 |
| 44 |
_locale_import_message |
15 |
0.22 |
| 45 |
format_plural |
15 |
0.22 |
| 46 |
stdClass |
15 |
0.22 |
| 47 |
_user_mail_text |
14 |
0.21 |
| 48 |
drupal_bootstrap |
14 |
0.21 |
| 49 |
menu_get_item |
14 |
0.21 |
| 50 |
drupal_set_header |
13 |
0.19 |
| 51 |
menu_rebuild |
13 |
0.19 |
| 52 |
cache_set |
12 |
0.18 |
| 53 |
db_add_field |
12 |
0.18 |
| 54 |
_db_query |
12 |
0.18 |
| 55 |
form_error |
12 |
0.18 |
| 56 |
variable_del |
12 |
0.18 |
| 57 |
db_fetch_array |
12 |
0.18 |
| 58 |
module_list |
12 |
0.18 |
| 59 |
drupal_mail |
11 |
0.16 |
| 60 |
drupal_get_destination |
11 |
0.16 |
| 61 |
drupal_load |
11 |
0.16 |
| 62 |
batch_process |
11 |
0.16 |
| 63 |
batch_get |
11 |
0.16 |
| 64 |
drupal_access_denied |
11 |
0.16 |
| 65 |
hook_schema |
10 |
0.15 |
| 66 |
form_set_value |
10 |
0.15 |
| 67 |
_db_query_callback |
10 |
0.15 |
| 68 |
node_load |
9 |
0.13 |
| 69 |
node_get_types |
9 |
0.13 |
| 70 |
module_rebuild_cache |
9 |
0.13 |
| 71 |
menu_link_save |
9 |
0.13 |
| 72 |
file_directory_path |
9 |
0.13 |
| 73 |
form_clean_id |
9 |
0.13 |
| 74 |
conf_path |
9 |
0.13 |
| 75 |
image_get_info |
9 |
0.13 |
| 76 |
update_get_projects |
9 |
0.13 |
| 77 |
db_change_field |
9 |
0.13 |
| 78 |
drupal_json |
8 |
0.12 |
| 79 |
file_scan_directory |
8 |
0.12 |
| 80 |
batch_set |
8 |
0.12 |
| 81 |
_form_set_class |
8 |
0.12 |
| 82 |
cache_get |
8 |
0.12 |
| 83 |
module_load_include |
8 |
0.12 |
| 84 |
tablesort_sql |
8 |
0.12 |
| 85 |
install_task_list |
8 |
0.12 |
| 86 |
_db_create_key_sql |
8 |
0.12 |
| 87 |
_db_error_page |
8 |
0.12 |
| 88 |
drupal_get_normal_path |
8 |
0.12 |
| 89 |
b |
8 |
0.12 |
| 90 |
hook_forms |
7 |
0.10 |
| 91 |
drupal_maintenance_theme |
7 |
0.10 |
| 92 |
drupal_set_content |
7 |
0.10 |
| 93 |
module_load_install |
7 |
0.10 |
| 94 |
file_create_path |
7 |
0.10 |
| 95 |
drupal_query_string_encode |
7 |
0.10 |
| 96 |
menu_link_delete |
7 |
0.10 |
| 97 |
_db_create_field_sql |
7 |
0.10 |
| 98 |
menu_execute_active_handler |
7 |
0.10 |
| 99 |
module_exists |
7 |
0.10 |
| 100 |
_locale_get_predefined_list |
7 |
0.10 |
This is a list of the 100 most common built-in PHP functions, and the 100 most common Drupal functions in the Drupal source code. Language constructs and reserved words are excluded from the count (foreach, for, while, list, isset, etc).
There were 1350 calls to 235 built-in functions in the source code, and 5483 calls to 1032 DRUPAL functions.
The Top 100 Built-in PHP Functions in Drupal
| Rank |
Function |
Occurrences |
Per Cent |
| 1 |
define |
94 |
6.75 |
| 2 |
implode |
79 |
5.68 |
| 3 |
array_merge |
63 |
4.53 |
| 4 |
substr |
58 |
4.17 |
| 5 |
trim |
38 |
2.73 |
| 6 |
str_replace |
38 |
2.73 |
| 7 |
count |
37 |
2.66 |
| 8 |
preg_replace |
35 |
2.51 |
| 9 |
array_pop |
33 |
2.37 |
| 10 |
array_shift |
31 |
2.23 |
| 11 |
explode |
30 |
2.16 |
| 12 |
ini_set |
29 |
2.08 |
| 13 |
header |
27 |
1.94 |
| 14 |
urldecode |
23 |
1.65 |
| 15 |
call_user_func_array |
22 |
1.58 |
| 16 |
func_get_args |
21 |
1.51 |
| 17 |
chr |
17 |
1.22 |
| 18 |
array_keys |
16 |
1.15 |
| 19 |
array_unshift |
15 |
1.08 |
| 20 |
preg_match |
15 |
1.08 |
| 21 |
preg_replace_callback |
15 |
1.08 |
| 22 |
in_array |
15 |
1.08 |
| 23 |
is_array |
14 |
1.01 |
| 24 |
strtr |
14 |
1.01 |
| 25 |
array_filter |
13 |
0.93 |
| 26 |
strpos |
12 |
0.86 |
| 27 |
md5 |
12 |
0.86 |
| 28 |
parse_url |
12 |
0.86 |
| 29 |
dirname |
11 |
0.79 |
| 30 |
unserialize |
11 |
0.79 |
| 31 |
max |
11 |
0.79 |
| 32 |
gmdate |
10 |
0.72 |
| 33 |
strlen |
9 |
0.65 |
| 34 |
printf |
9 |
0.65 |
| 35 |
time |
9 |
0.65 |
| 36 |
pg_query |
9 |
0.65 |
| 37 |
serialize |
8 |
0.57 |
| 38 |
round |
8 |
0.57 |
| 39 |
array_walk |
8 |
0.57 |
| 40 |
array_flip |
8 |
0.57 |
| 41 |
date |
8 |
0.57 |
| 42 |
array_unique |
8 |
0.57 |
| 43 |
ksort |
8 |
0.57 |
| 44 |
str_repeat |
7 |
0.50 |
| 45 |
mysqli_query |
7 |
0.50 |
| 46 |
array_map |
7 |
0.50 |
| 47 |
asort |
7 |
0.50 |
| 48 |
mysql_query |
7 |
0.50 |
| 49 |
file_get_contents |
6 |
0.43 |
| 50 |
function_exists |
6 |
0.43 |
| 51 |
register_shutdown_function |
6 |
0.43 |
| 52 |
array_reverse |
6 |
0.43 |
| 53 |
ceil |
5 |
0.36 |
| 54 |
fclose |
5 |
0.36 |
| 55 |
urlencode |
5 |
0.36 |
| 56 |
xml_parser_create |
5 |
0.36 |
| 57 |
uasort |
5 |
0.36 |
| 58 |
file |
5 |
0.36 |
| 59 |
strstr |
5 |
0.36 |
| 60 |
basename |
5 |
0.36 |
| 61 |
base64_encode |
5 |
0.36 |
| 62 |
bcmod |
5 |
0.36 |
| 63 |
min |
5 |
0.36 |
| 64 |
strtolower |
5 |
0.36 |
| 65 |
floor |
4 |
0.29 |
| 66 |
array_merge_recursive |
4 |
0.29 |
| 67 |
array_slice |
4 |
0.29 |
| 68 |
preg_match_all |
4 |
0.29 |
| 69 |
ob_start |
4 |
0.29 |
| 70 |
mysql_connect |
4 |
0.29 |
| 71 |
abs |
4 |
0.29 |
| 72 |
realpath |
4 |
0.29 |
| 73 |
ltrim |
4 |
0.29 |
| 74 |
mail |
4 |
0.29 |
| 75 |
preg_split |
4 |
0.29 |
| 76 |
base64_decode |
4 |
0.29 |
| 77 |
chmod |
4 |
0.29 |
| 78 |
array_key_exists |
4 |
0.29 |
| 79 |
call_user_func |
4 |
0.29 |
| 80 |
ob_end_clean |
4 |
0.29 |
| 81 |
ord |
4 |
0.29 |
| 82 |
array_values |
3 |
0.22 |
| 83 |
is_numeric |
3 |
0.22 |
| 84 |
xml_parser_free |
3 |
0.22 |
| 85 |
debug_backtrace |
3 |
0.22 |
| 86 |
pg_last_error |
3 |
0.22 |
| 87 |
is_dir |
3 |
0.22 |
| 88 |
intval |
3 |
0.22 |
| 89 |
xml_set_character_data_handler |
3 |
0.22 |
| 90 |
is_string |
3 |
0.22 |
| 91 |
stripslashes |
3 |
0.22 |
| 92 |
sort |
3 |
0.22 |
| 93 |
fopen |
3 |
0.22 |
| 94 |
ini_get |
3 |
0.22 |
| 95 |
xml_set_element_handler |
3 |
0.22 |
| 96 |
trigger_error |
3 |
0.22 |
| 97 |
extract |
3 |
0.22 |
| 98 |
is_object |
3 |
0.22 |
| 99 |
array_diff |
3 |
0.22 |
| 100 |
link |
3 |
0.22 |
Total Drupal Functions Used: 1647
Total Custom Drupal Function calls in Drupal source code: 6819.
The Top 100 Drupal Native Functions
| Rank |
Function |
Occurrences |
Per Cent |
| 1 |
t |
1133 |
16.62 |
| 2 |
theme |
273 |
4.00 |
| 3 |
db_query |
230 |
3.37 |
| 4 |
drupal_set_message |
214 |
3.14 |
| 5 |
variable_get |
148 |
2.17 |
| 6 |
drupal_render |
113 |
1.66 |
| 7 |
form_set_error |
89 |
1.31 |
| 8 |
check_plain |
80 |
1.17 |
| 9 |
watchdog |
78 |
1.14 |
| 10 |
l |
73 |
1.07 |
| 11 |
st |
68 |
1.00 |
| 12 |
drupal_set_title |
66 |
0.97 |
| 13 |
drupal_get_form |
59 |
0.87 |
| 14 |
variable_set |
52 |
0.76 |
| 15 |
system_settings_form |
43 |
0.63 |
| 16 |
cache_clear_all |
43 |
0.63 |
| 17 |
update_sql |
40 |
0.59 |
| 18 |
drupal_goto |
39 |
0.57 |
| 19 |
drupal_add_js |
38 |
0.56 |
| 20 |
db_result |
34 |
0.50 |
| 21 |
url |
34 |
0.50 |
| 22 |
theme_get_setting |
33 |
0.48 |
| 23 |
confirm_form |
32 |
0.47 |
| 24 |
base_path |
27 |
0.40 |
| 25 |
pager_query |
27 |
0.40 |
| 26 |
drupal_add_css |
27 |
0.40 |
| 27 |
module_invoke |
27 |
0.40 |
| 28 |
format_date |
26 |
0.38 |
| 29 |
check_url |
26 |
0.38 |
| 30 |
drupal_not_found |
25 |
0.37 |
| 31 |
db_fetch_object |
25 |
0.37 |
| 32 |
module_invoke_all |
22 |
0.32 |
| 33 |
drupal_attributes |
19 |
0.28 |
| 34 |
drupal_alter |
19 |
0.28 |
| 35 |
drupal_map_assoc |
19 |
0.28 |
| 36 |
db_query_range |
18 |
0.26 |
| 37 |
language_list |
17 |
0.25 |
| 38 |
get_t |
17 |
0.25 |
| 39 |
drupal_add_tabledrag |
17 |
0.25 |
| 40 |
xmlrpc_error |
17 |
0.25 |
| 41 |
language_default |
16 |
0.23 |
| 42 |
arg |
16 |
0.23 |
| 43 |
template_preprocess |
16 |
0.23 |
| 44 |
_locale_import_message |
15 |
0.22 |
| 45 |
format_plural |
15 |
0.22 |
| 46 |
stdClass |
15 |
0.22 |
| 47 |
_user_mail_text |
14 |
0.21 |
| 48 |
drupal_bootstrap |
14 |
0.21 |
| 49 |
menu_get_item |
14 |
0.21 |
| 50 |
drupal_set_header |
13 |
0.19 |
| 51 |
menu_rebuild |
13 |
0.19 |
| 52 |
cache_set |
12 |
0.18 |
| 53 |
db_add_field |
12 |
0.18 |
| 54 |
_db_query |
12 |
0.18 |
| 55 |
form_error |
12 |
0.18 |
| 56 |
variable_del |
12 |
0.18 |
| 57 |
db_fetch_array |
12 |
0.18 |
| 58 |
module_list |
12 |
0.18 |
| 59 |
drupal_mail |
11 |
0.16 |
| 60 |
drupal_get_destination |
11 |
0.16 |
| 61 |
drupal_load |
11 |
0.16 |
| 62 |
batch_process |
11 |
0.16 |
| 63 |
batch_get |
11 |
0.16 |
| 64 |
drupal_access_denied |
11 |
0.16 |
| 65 |
hook_schema |
10 |
0.15 |
| 66 |
form_set_value |
10 |
0.15 |
| 67 |
_db_query_callback |
10 |
0.15 |
| 68 |
node_load |
9 |
0.13 |
| 69 |
node_get_types |
9 |
0.13 |
| 70 |
module_rebuild_cache |
9 |
0.13 |
| 71 |
menu_link_save |
9 |
0.13 |
| 72 |
file_directory_path |
9 |
0.13 |
| 73 |
form_clean_id |
9 |
0.13 |
| 74 |
conf_path |
9 |
0.13 |
| 75 |
image_get_info |
9 |
0.13 |
| 76 |
update_get_projects |
9 |
0.13 |
| 77 |
db_change_field |
9 |
0.13 |
| 78 |
drupal_json |
8 |
0.12 |
| 79 |
file_scan_directory |
8 |
0.12 |
| 80 |
batch_set |
8 |
0.12 |
| 81 |
_form_set_class |
8 |
0.12 |
| 82 |
cache_get |
8 |
0.12 |
| 83 |
module_load_include |
8 |
0.12 |
| 84 |
tablesort_sql |
8 |
0.12 |
| 85 |
install_task_list |
8 |
0.12 |
| 86 |
_db_create_key_sql |
8 |
0.12 |
| 87 |
_db_error_page |
8 |
0.12 |
| 88 |
drupal_get_normal_path |
8 |
0.12 |
| 89 |
b |
8 |
0.12 |
| 90 |
hook_forms |
7 |
0.10 |
| 91 |
drupal_maintenance_theme |
7 |
0.10 |
| 92 |
drupal_set_content |
7 |
0.10 |
| 93 |
module_load_install |
7 |
0.10 |
| 94 |
file_create_path |
7 |
0.10 |
| 95 |
drupal_query_string_encode |
7 |
0.10 |
| 96 |
menu_link_delete |
7 |
0.10 |
| 97 |
_db_create_field_sql |
7 |
0.10 |
| 98 |
menu_execute_active_handler |
7 |
0.10 |
| 99 |
module_exists |
7 |
0.10 |
| 100 |
_locale_get_predefined_list |
7 |
0.10 |