---
title: "The 100 PHP functions in 2026"
url: https://www.exakat.io/the-100-php-functions-in-2026/
date: 2026-12-03
modified: 2026-12-03
lang: en
author: "dams"
description: "The 100 PHP functions in 2026 Here is the top 100 PHP functions : it is the list of the most often used PHP native functions. The functions are named,..."
categories:
  - "Technology"
tags:
  - "function"
  - "php"
  - "top 100"
image: https://www.exakat.io/wp-content/uploads/2026/12/keys.640.jpg
word_count: 1342
---

# The 100 PHP functions in 2026

# The 100 PHP functions in 2026

Here is the top 100 PHP functions : it is the list of the most often used PHP native functions.

The functions are named, and ranked from 1 to 100. The other 3000+ native PHP functions are not ranked here. The frequency column represents how often a function is used across PHP code repositories: the reference corpus is a list of 3017 PHP Open Source projects, covering the tops 1000 composer packages in recent years, github/gitlab/gitee public repo, downloaded archives, etc... They were audited with Exakat static analysis engine, version 2.7.7. The average is the number of times a function is called within one project.

For example, 4 project out of 5 uses the [count()](https://www.php.net/manual/en/function.count.php) function. When used, [count()](https://www.php.net/manual/en/function.count.php) is called around 61 times on average. It is both a popular and heavily used function. By contrast, [file*put*contents()](https://www.php.net/manual/en/function.file-put-contents.php) is popular with 45% projects using it, but sparsely used, with 6 usage each time.

Click on the link to go to the documentation. There are more insights at the bottom of the top 100.

## The 100 most popular PHP functions

| 1 | [file_exists](https://www.php.net/manual/en/function.file-exists.php) | 63.40% | 14 |
| --- | --------------------------------------------------------------------- | ------ | --- |
| 2 | [count](https://www.php.net/manual/en/function.count.php) | 62.56% | 68 |
| 3 | [implode](https://www.php.net/manual/en/function.implode.php) | 61.24% | 39 |
| 4 | [substr](https://www.php.net/manual/en/function.substr.php) | 58.99% | 49 |
| 5 | [sprintf](https://www.php.net/manual/en/function.sprintf.php) | 58.60% | 83 |
| 6 | [array_merge](https://www.php.net/manual/en/function.array-merge.php) | 58.27% | 33 |
| 7 | [in_array](https://www.php.net/manual/en/function.in-array.php) | 57.61% | 42 |
| 8 | [dirname](https://www.php.net/manual/en/function.dirname.php) | 57.04% | 13 |
| 9 | [is_array](https://www.php.net/manual/en/function.is-array.php) | 57.01% | 61 |
| 10 | [explode](https://www.php.net/manual/en/function.explode.php) | 56.74% | 29 |
| 11 | [str_replace](https://www.php.net/manual/en/function.str-replace.php) | 56.09% | 34 |
| 12 | [strlen](https://www.php.net/manual/en/function.strlen.php) | 55.16% | 36 |
| 13 | [strpos](https://www.php.net/manual/en/function.strpos.php) | 55.13% | 21 |
| 14 | [array_key_exists](https://www.php.net/manual/en/function.array-key-exists.php) | 53.51% | 86 |
| 15 | [array_keys](https://www.php.net/manual/en/function.array-keys.php) | 53.48% | 17 |
| 16 | [preg_match](https://www.php.net/manual/en/function.preg-match.php) | 51.77% | 33 |
| 17 | [file_get_contents](https://www.php.net/manual/en/function.file-get-contents.php) | 50.36% | 9 |
| 18 | [trim](https://www.php.net/manual/en/function.trim.php) | 49.40% | 34 |
| 19 | [is_string](https://www.php.net/manual/en/function.is-string.php) | 48.14% | 27 |
| 20 | [array_values](https://www.php.net/manual/en/function.array-values.php) | 48.05% | 11 |
| 21 | [array_map](https://www.php.net/manual/en/function.array-map.php) | 46.67% | 17 |
| 22 | [strtolower](https://www.php.net/manual/en/function.strtolower.php) | 45.23% | 22 |
| 23 | [file_put_contents](https://www.php.net/manual/en/function.file-put-contents.php) | 45.08% | 6 |
| 24 | [is_file](https://www.php.net/manual/en/function.is-file.php) | 44.93% | 6 |
| 25 | [method_exists](https://www.php.net/manual/en/function.method-exists.php) | 44.51% | 9 |
| 26 | [preg_replace](https://www.php.net/manual/en/function.preg-replace.php) | 44.33% | 17 |
| 27 | [function_exists](https://www.php.net/manual/en/function.function-exists.php) | 43.47% | 19 |
| 28 | [json_encode](https://www.php.net/manual/en/function.json-encode.php) | 41.94% | 16 |
| 29 | [json_decode](https://www.php.net/manual/en/function.json-decode.php) | 41.70% | 10 |
| 30 | [array_filter](https://www.php.net/manual/en/function.array-filter.php) | 41.58% | 10 |
| 31 | [is_dir](https://www.php.net/manual/en/function.is-dir.php) | 41.34% | 7 |
| 32 | [defined](https://www.php.net/manual/en/function.defined.php) | 41.22% | 19 |
| 33 | [rtrim](https://www.php.net/manual/en/function.rtrim.php) | 39.90% | 7 |
| 34 | [class_exists](https://www.php.net/manual/en/function.class-exists.php) | 39.00% | 12 |
| 35 | [strtr](https://www.php.net/manual/en/function.strtr.php) | 38.49% | 5 |
| 36 | [fwrite](https://www.php.net/manual/en/function.fwrite.php) | 38.37% | 5 |
| 37 | [filter_var](https://www.php.net/manual/en/function.filter-var.php) | 38.07% | 3 |
| 38 | [call_user_func](https://www.php.net/manual/en/function.call-user-func.php) | 37.98% | 3 |
| 39 | [strrpos](https://www.php.net/manual/en/function.strrpos.php) | 37.17% | 3 |
| 40 | [realpath](https://www.php.net/manual/en/function.realpath.php) | 36.87% | 5 |
| 41 | [array_flip](https://www.php.net/manual/en/function.array-flip.php) | 36.81% | 3 |
| 42 | [header](https://www.php.net/manual/en/function.header.php) | 36.42% | 9 |
| 43 | [call_user_func_array](https://www.php.net/manual/en/function.call-user-func-array.php) | 35.70% | 3 |
| 44 | [ini_get](https://www.php.net/manual/en/function.ini-get.php) | 35.40% | 4 |
| 45 | [unlink](https://www.php.net/manual/en/function.unlink.php) | 35.22% | 6 |
| 46 | [array_shift](https://www.php.net/manual/en/function.array-shift.php) | 34.29% | 6 |
| 47 | [is_object](https://www.php.net/manual/en/function.is-object.php) | 34.26% | 11 |
| 48 | [is_int](https://www.php.net/manual/en/function.is-int.php) | 33.75% | 7 |
| 49 | [get_class](https://www.php.net/manual/en/function.get-class.php) | 33.09% | 9 |
| 50 | [is_numeric](https://www.php.net/manual/en/function.is-numeric.php) | 33.06% | 9 |
| 51 | [mkdir](https://www.php.net/manual/en/function.mkdir.php) | 32.88% | 3 |
| 52 | [ltrim](https://www.php.net/manual/en/function.ltrim.php) | 32.79% | 4 |
| 53 | [strtoupper](https://www.php.net/manual/en/function.strtoupper.php) | 32.52% | 7 |
| 54 | [array_unique](https://www.php.net/manual/en/function.array-unique.php) | 32.10% | 5 |
| 55 | [basename](https://www.php.net/manual/en/function.basename.php) | 31.92% | 5 |
| 56 | [fopen](https://www.php.net/manual/en/function.fopen.php) | 31.59% | 6 |
| 57 | [array_slice](https://www.php.net/manual/en/function.array-slice.php) | 31.56% | 5 |
| 58 | [trigger_error](https://www.php.net/manual/en/function.trigger-error.php) | 31.38% | 5 |
| 59 | [array_pop](https://www.php.net/manual/en/function.array-pop.php) | 31.38% | 5 |
| 60 | [str_repeat](https://www.php.net/manual/en/function.str-repeat.php) | 30.70% | 8 |
| 61 | [spl_autoload_register](https://www.php.net/manual/en/function.spl-autoload-register.php) | 30.40% | 1 |
| 62 | [fclose](https://www.php.net/manual/en/function.fclose.php) | 30.01% | 5 |
| 63 | [max](https://www.php.net/manual/en/function.max.php) | 29.89% | 7 |
| 64 | [time](https://www.php.net/manual/en/function.time.php) | 29.62% | 13 |
| 65 | [preg_match_all](https://www.php.net/manual/en/function.preg-match-all.php) | 29.23% | 3 |
| 66 | [headers_sent](https://www.php.net/manual/en/function.headers-sent.php) | 28.96% | 1 |
| 67 | [is_bool](https://www.php.net/manual/en/function.is-bool.php) | 28.75% | 3 |
| 68 | [microtime](https://www.php.net/manual/en/function.microtime.php) | 28.15% | 4 |
| 69 | [array_search](https://www.php.net/manual/en/function.array-search.php) | 28.09% | 3 |
| 70 | [preg_split](https://www.php.net/manual/en/function.preg-split.php) | 27.91% | 3 |
| 71 | [is_callable](https://www.php.net/manual/en/function.is-callable.php) | 27.88% | 4 |
| 72 | [extension_loaded](https://www.php.net/manual/en/function.extension-loaded.php) | 27.85% | 3 |
| 73 | [array_unshift](https://www.php.net/manual/en/function.array-unshift.php) | 27.85% | 3 |
| 74 | [end](https://www.php.net/manual/en/function.end.php) | 27.40% | 3 |
| 75 | [min](https://www.php.net/manual/en/function.min.php) | 27.16% | 4 |
| 76 | [ucfirst](https://www.php.net/manual/en/function.ucfirst.php) | 27.16% | 5 |
| 77 | [date](https://www.php.net/manual/en/function.date.php) | 27.10% | 12 |
| 78 | [md5](https://www.php.net/manual/en/function.md5.php) | 27.01% | 4 |
| 79 | [ksort](https://www.php.net/manual/en/function.ksort.php) | 26.95% | 3 |
| 80 | [preg_quote](https://www.php.net/manual/en/function.preg-quote.php) | 26.92% | 3 |
| 81 | [var_export](https://www.php.net/manual/en/function.var-export.php) | 26.80% | 3 |
| 82 | [parse_url](https://www.php.net/manual/en/function.parse-url.php) | 26.80% | 3 |
| 83 | [reset](https://www.php.net/manual/en/function.reset.php) | 26.74% | 3 |
| 84 | [is_null](https://www.php.net/manual/en/function.is-null.php) | 26.62% | 22 |
| 85 | [array_diff](https://www.php.net/manual/en/function.array-diff.php) | 26.35% | 3 |
| 86 | [gettype](https://www.php.net/manual/en/function.gettype.php) | 26.32% | 3 |
| 87 | [array_reverse](https://www.php.net/manual/en/function.array-reverse.php) | 26.29% | 2 |
| 88 | [base64_encode](https://www.php.net/manual/en/function.base64-encode.php) | 26.23% | 3 |
| 89 | [round](https://www.php.net/manual/en/function.round.php) | 26.05% | 5 |
| 90 | [getenv](https://www.php.net/manual/en/function.getenv.php) | 25.51% | 4 |
| 91 | [preg_replace_callback](https://www.php.net/manual/en/function.preg-replace-callback.php) | 25.51% | 3 |
| 92 | [getcwd](https://www.php.net/manual/en/function.getcwd.php) | 25.30% | 1 |
| 93 | [spl_autoload_unregister](https://www.php.net/manual/en/function.spl-autoload-unregister.php) | 24.82% | 1 |
| 94 | [apcu_fetch](https://www.php.net/manual/en/function.apcu-fetch.php) | 24.79% | 1 |
| 95 | [str_contains](https://www.php.net/manual/en/function.str-contains.php) | 24.73% | 10 |
| 96 | [floor](https://www.php.net/manual/en/function.floor.php) | 24.73% | 3 |
| 97 | [str_starts_with](https://www.php.net/manual/en/function.str-starts-with.php) | 24.58% | 10 |
| 98 | [version_compare](https://www.php.net/manual/en/function.version-compare.php) | 24.49% | 3 |
| 99 | [serialize](https://www.php.net/manual/en/function.serialize.php) | 24.37% | 4 |
| 100 | [stream_resolve_include_path](https://www.php.net/manual/en/function.stream-resolve-include-path.php) | 23.92% | 1 |

## Top 100 PHP functions insights

Compared with the [2024 ranking](https://www.exakat.io/the-top-100-php-functions-in-2024/) (2,500 projects, Exakat 2.4.7), this edition uses 3,017 projects and Exakat 2.7.7. Ranks and shares of projects are the figures to compare across editions. Average calls per project fell for 77 of the 97 functions present in both lists, so they only compare well within this edition.

**Trends since 2024**

- Strings still lead, then arrays, then files, and the order is unchanged: [file_exists()](https://www.php.net/manual/en/function.file-exists.php) is still first and [count()](https://www.php.net/manual/en/function.count.php) second. [str_replace()](https://www.php.net/manual/en/function.str-replace.php) fell hardest, from 3rd to 11th.
- Math is creeping up: [min()](https://www.php.net/manual/en/function.min.php) moved from 98th to 75th, [round()](https://www.php.net/manual/en/function.round.php) from 97th to 89th, and [floor()](https://www.php.net/manual/en/function.floor.php) entered at 96th. [max()](https://www.php.net/manual/en/function.max.php) still beats [min()](https://www.php.net/manual/en/function.min.php), but the gap narrowed from 26 places to 12.
- Two PHP 8.0 functions entered the list: [str_contains()](https://www.php.net/manual/en/function.str-contains.php) (95th) and [str*starts*with()](https://www.php.net/manual/en/function.str-starts-with.php)(97th). [strpos()](https://www.php.net/manual/en/function.strpos.php) still ranks 13th, down from 11th.
- Autoload and cache plumbing lost ground: [spl*autoload*unregister()](https://www.php.net/manual/en/function.spl-autoload-unregister.php) fell from 69th to 93rd, [apcu_fetch()](https://www.php.net/manual/en/function.apcu-fetch.php) from 74th to 94th, and [stream*resolve*include_path()](https://www.php.net/manual/en/function.stream-resolve-include-path.php) from 81st to 100th. [spl*autoload*register()](https://www.php.net/manual/en/function.spl-autoload-register.php) also slipped, from 51st to 61st. [apcu_add()](https://www.php.net/manual/en/function.apcu-add.php) and [current()](https://www.php.net/manual/en/function.current.php)dropped out.
- md5 rose from 82nd to 78th, and it is still the only widely used crypto function: it is noteworthy that [md5()](https://www.php.net/manual/en/function.md5.php) is not only used for crypto, but as a cheap hashing for cache. [hash()](https://www.php.net/manual/en/function.hash.php) was 159th in 2024 according to that page, and it is still outside the top 100. This must change, even for cache!

**Recent PHP functions (8.4 and 8.5)**

- None of the functions added in PHP 8.4 or 8.5 is in the top 100 yet. This is an adoption lag, not a verdict on the functions. PHP 8.4 came out in November 2024 and 8.5 in November 2025, but libraries keep supporting older PHP versions and use polyfills, such as symfony/polyfill-php84, until their minimum version moves on. [str_contains()](https://www.php.net/manual/en/function.str-contains.php) took a few years to get here, so expect the 8.4 and 8.5 functions to appear in later editions first in array and mb_ code.

**Stable insights**

- Usage of composer may reduce the need for some native functions, by federating them in a component. For example, a filesystem component can absorb [file_exists()](https://www.php.net/manual/en/function.file-exists.php), [mkdir()](https://www.php.net/manual/en/function.mkdir.php) and [unlink()](https://www.php.net/manual/en/function.unlink.php) calls. The ultimate form a framework may simply be when it has replaced every native PHP by its own, for decoupling, features and management reasons.
- Extensions in the top 100: filter ([filter_var()](https://www.php.net/manual/en/function.filter-var.php)), json, PCRE (six preg_* functions), SPL ([spl*autoload*register()](https://www.php.net/manual/en/function.spl-autoload-register.php)) and APCu ([apcu_fetch()](https://www.php.net/manual/en/function.apcu-fetch.php)).
- No mb_* function makes the top 100, while [strlen()](https://www.php.net/manual/en/function.strlen.php), [substr()](https://www.php.net/manual/en/function.substr.php), [strtolower()](https://www.php.net/manual/en/function.strtolower.php), [strtoupper()](https://www.php.net/manual/en/function.strtoupper.php) and [ucfirst()](https://www.php.net/manual/en/function.ucfirst.php) all do. Most PHP code still counts bytes, not characters.
- [json_encode()](https://www.php.net/manual/en/function.json-encode.php) and [json_decode()](https://www.php.net/manual/en/function.json-decode.php) are still used by almost the same share of projects (41.94% and 41.70%), but [json_encode()](https://www.php.net/manual/en/function.json-encode.php) is called 60% more often per project (16 times against 10): do PHP application produce more JSON code than it reads?
- Database functions (pdo, mysqli*, pg_*…) are still out of scope, as they are used in classes or components. None appear in the top 100.
- No recently deprecated function is in the top 100: this is a good thing.
- Debug functions such as [print_r()](https://www.php.net/manual/en/function.print-r.php) and [var_dump()](https://www.php.net/manual/en/function.var-dump.php) are out of the top 100. [var_export()](https://www.php.net/manual/en/function.var-export.php) is in, at 81st (70th in 2024): it is probably used to generate PHP code (cache files, config, fixtures) more than to debug.
- array, echo, print, eval, empty, isset and other language constructs were not counted as functions in this ranking. They are language constructs, but this is a detail.
- Several functions could be replaced by syntax: [is_null($x)](https://www.php.net/manual/en/function.is-null.php) by $x === null (84th), [call*user*func($f, ...$args)](https://www.php.net/manual/en/function.call-user-func.php) and [call*user*func_array($f, $args)](https://www.php.net/manual/en/function.call-user-func-array.php) by $f(...$args) (38th and 43rd), [is_object($x)](https://www.php.net/manual/en/function.is-object.php) by instanceof when the class is known (47th).
- Checking before acting is common: [file_exists()](https://www.php.net/manual/en/function.file-exists.php) is the most widespread function, and seven existence checks ([file_exists()](https://www.php.net/manual/en/function.file-exists.php), [is_file()](https://www.php.net/manual/en/function.is-file.php), [is_dir()](https://www.php.net/manual/en/function.is-dir.php), [function_exists()](https://www.php.net/manual/en/function.function-exists.php), [method_exists()](https://www.php.net/manual/en/function.method-exists.php), [class_exists()](https://www.php.net/manual/en/function.class-exists.php), [defined()](https://www.php.net/manual/en/function.defined.php)) all sit in the top 35.
- Once a project uses them, [array*key*exists()](https://www.php.net/manual/en/function.array-key-exists.php) (86 calls per project on average) and [sprintf()](https://www.php.net/manual/en/function.sprintf.php) (83) are called the most, ahead of [count()](https://www.php.net/manual/en/function.count.php) (68).
- Types are still a major concern: eight is_* type checks ([is_array()](https://www.php.net/manual/en/function.is-array.php), [is_string()](https://www.php.net/manual/en/function.is-string.php), [is_object()](https://www.php.net/manual/en/function.is-object.php), [is_int()](https://www.php.net/manual/en/function.is-int.php), [is_numeric()](https://www.php.net/manual/en/function.is-numeric.php), [is_bool()](https://www.php.net/manual/en/function.is-bool.php), [is_callable()](https://www.php.net/manual/en/function.is-callable.php), [is_null()](https://www.php.net/manual/en/function.is-null.php)) and [gettype()](https://www.php.net/manual/en/function.gettype.php) are in the top 100. Is it a string? Is it an object? No, it's a resource! [is_resource()](https://www.php.net/manual/en/function.is-resource.php) is not in the list, but [fopen()](https://www.php.net/manual/en/function.fopen.php), [fwrite()](https://www.php.net/manual/en/function.fwrite.php) and [fclose()](https://www.php.net/manual/en/function.fclose.php) are, so it actually should be close by.

## Challenges

If you are learning PHP, it is a good idea to review the 100 functions ranked here : they are the features you’ll find the most often when landing on a coding team. They are not the only ones, but you’ll be less surprised when meeting them. More details?

Follow us on BlueSky or mastodon if you want more details, more stats