This repository is a PHP 8 migration layer for old PHP applications.
It supports realistic compatibility for code originally written for:
- PHP 5.x
- PHP 7.x
- early PHP 8 versions with newly deprecated behavior
This project intentionally distinguishes between different compatibility types.
A true polyfill restores removed behavior closely enough that old code can keep working with the same basic expectations.
Examples:
each()create_function()is_real()image2wbmp()when GD is available
A partial polyfill restores the useful core behavior, but some edge cases cannot be reproduced exactly because the old runtime or engine features are gone.
Examples:
session_register()session_unregister()session_is_registered()
A safe fallback reports the modern truth honestly instead of pretending an old engine feature still exists.
Examples:
get_magic_quotes_gpc()get_magic_quotes_runtime()set_magic_quotes_runtime()
A compatibility approximation recreates the most useful practical behavior, while clearly documenting limits where exact restoration is impossible.
Examples:
ereg()and related POSIX regex wrapperslegacy_compat_strftime()legacy_compat_gmstrftime()money_format()in universal mode only
The universal file is intended for real-world migration rescue work. It keeps a broader compatibility surface and includes carefully documented approximations when those approximations are still honest and operationally useful.
The strict file is intended for teams that want a safer default. It excludes looser behavior where the risk of silent semantic drift is higher.
Examples of stricter choices:
money_format()is omitted- helper behavior is tighter for counting, array merging, and implode handling
- session compatibility behavior is more conservative
The compatibility files are especially relevant to:
- WordPress
- Laravel
- Symfony
- CodeIgniter
- Magento
- custom PHP frameworks
- internal enterprise platforms
They are not framework-specific files, but they are designed around the kinds of legacy breakage commonly seen in those ecosystems during PHP 8 upgrades.