Thank you for contributing to this PHP legacy compatibility project.
This repository exists to help developers migrate old PHP applications to PHP 8.x without shipping dishonest compatibility code.
Primary use cases include:
- WordPress legacy themes and plugins
- Laravel legacy applications
- Symfony legacy bundles
- CodeIgniter 2 and 3 projects
- Magento 1 and legacy Magento integrations
- Custom PHP frameworks and enterprise systems
- Fork the repository.
- Create a feature branch.
- Make focused changes with clear intent.
- Add or update documentation when behavior changes.
- Run syntax validation before opening a pull request.
- Submit a pull request with a clear problem statement and implementation summary.
- Use clear procedural PHP where early bootstrap safety matters.
- Keep all code and comments in English.
- Prefer clarity over clever abstractions.
- Preserve compatibility behavior only when it can be reproduced honestly.
- Document every public helper or polyfill with a full docblock.
- Keep section ordering logical and version-aware.
This repository does not accept:
- fake success returns
- dishonest stubs
- fake extension recreations such as ext/mysql, ext/mcrypt, or fake crypto substitutes
- silent data corruption disguised as compatibility
- placeholders that only hide fatal errors without restoring meaningful behavior
If a behavior cannot be restored exactly, the closest practical approximation must be documented clearly, including the limitation and why it exists.
This package intentionally does not auto-load both compatibility files through Composer.
Why:
php-legacy-compat-universal.phpandphp-legacy-compat-strict.phpare mutually exclusive- auto-loading both would mix two compatibility policies in the same runtime
- projects must intentionally choose one mode during bootstrap
Contributions must preserve that design unless there is a very strong and clearly documented reason to change it.
At minimum, contributors should:
- run
php -lagainst changed PHP files - run the repository lint workflow locally when practical
- test the changed behavior on PHP 8.0, 8.1, 8.2, or 8.3 when relevant
- verify that universal and strict modes still remain intentionally different
- check that no redeclaration or bootstrap-order issues were introduced
If a change affects a removed or deprecated function, include a small usage example or reproducible case in the pull request description.
Pull requests should:
- address a real compatibility problem
- explain the original historical behavior
- state whether the implementation is a true polyfill, partial polyfill, safe fallback, or compatibility approximation
- document limitations honestly
- avoid unrelated formatting churn
Good pull request summaries usually include:
- the old failing code pattern
- the PHP 8 error or regression it caused
- why the new implementation is accurate enough to ship
- what remains intentionally unsupported
- what release impact the change has: patch, minor, or major
This project follows semantic versioning.
- patch: non-breaking fixes, docs, metadata, safer bug fixes
- minor: new non-breaking compatibility coverage or helpers
- major: breaking compatibility-policy changes, renamed files, removed APIs, or changed loading expectations
If you believe a change deserves a new version category, mention that in the pull request.
Documentation improvements are welcome, especially for:
- PHP 8 migration examples
- WordPress migration scenarios
- Laravel and Symfony upgrade notes
- CodeIgniter and Magento legacy usage
- search-friendly documentation improvements that remain technically honest
- release documentation and Packagist install guidance
When opening an issue, include:
- PHP version
- which file you loaded: universal or strict
- the failing legacy code sample
- the actual error message
- the expected legacy behavior
By contributing to this repository, you agree that your contributions will be licensed under the MIT License.