PHP version compatibility checker
Paste PHP code to find deprecated or removed functions, syntax, and features. Covers PHP 5.3 through 8.4 with plain-English explanations and upgrade paths.
PHP version removal timeline — what broke when
| What was removed | Deprecated | Removed | Use instead |
|---|---|---|---|
| mysql_* functions | 5.5 | 7.0 | PDO or mysqli_*() |
| ereg() / eregi() functions | 5.3 | 7.0 | preg_match(), preg_replace() |
| mcrypt functions | 7.1 | 7.2 | openssl_encrypt() / openssl_decrypt() |
| create_function() | 7.2 | 8.0 | Anonymous functions (closures) |
| each() | 7.2 | 8.0 | foreach() |
| __autoload() | 7.2 | 8.0 | spl_autoload_register() |
| FILTER_SANITIZE_STRING | 8.1 | — | htmlspecialchars() or custom sanitization |
| mhash() / mhash_* | 5.3 | 7.0 | hash() functions |
| utf8_encode() / utf8_decode() | 8.2 | — | mb_convert_encoding() |
| ${var} string interpolation | 8.2 | 9.0 | {$var} or "$var" |
| Nullable type (implicit) | 8.4 | — | Explicit ?type notation |
| preg_replace() with /e modifier | 5.5 | 7.0 | preg_replace_callback() |
| split() / spliti() | 5.3 | 7.0 | explode() or preg_split() |
| money_format() | 7.4 | 8.0 | NumberFormatter class |
| get_magic_quotes_gpc() / get_magic_quotes_runtime() | 7.4 | 8.0 | Not needed — magic quotes was removed in PHP 5.4 |
| hebrevc() / hebrev() | 7.4 | 8.0 | Intl extension functions |
| strpos() / strstr() with integer needle | 7.3 | — | Use a string needle |
| assert() with string argument | 7.2 | 8.0 | assert() with boolean expression |
| ldap_sort() | 8.0 | 8.4 | usort() with ldap_get_entries() |
| curl_version() without argument | 8.0 | — | curl_version() with no argument |
| Deprecated constructor-style methods | 7.0 | 8.0 | __construct() |
| Deprecated mbstring encoding aliases | 8.2 | — | Use standard encoding names: UTF-8, ASCII |
| strftime() / gmstrftime() | 8.1 | — | date() or IntlDateFormatter |
Upgrading a legacy PHP application?
Browse ebooks →
View courses →
PDO, modern PHP patterns, and upgrade strategies — covered in our PHP developer ebooks and courses.