janpiet / php-version-transpiler
Transpile php 7 code to php 5.6 code
Installs: 1 110
Dependents: 1
Suggesters: 0
Security: 0
Stars: 10
Watchers: 4
Forks: 4
Open Issues: 0
Requires
- php: >=7.0.0
- nikic/php-parser: ^3.0
- symfony/console: ^3.0
- symfony/filesystem: ^3.0
- symfony/finder: ^3.0
Requires (Dev)
- phpunit/phpunit: ^5.3
- symfony/process: ^3.0
This package is auto-updated.
Last update: 2024-11-20 22:58:00 UTC
README
PHP Version Transpiler
Remove PHP7 language features and add PHP 5.6 compatible syntax :)
Install:
composer require janpiet/php-version-transpiler
Usage:
_Bin_Path/_php-version-transpiler _PHP_7_Source_Directory_ _PHP_5_6_Target_Directory_
Run tests:
composer install
bin/phpunit
View the files it generates:
- Input:
tests/_fixtures
- Output:
tests/_out
Installation
requires composer & php7
composer install
bin/phpunit
Support
As with every solution to such a problem there is no way to solve erverything, and there is no way to solve everything with one thing. I suspect there will far more use cases for a Shim for many incompatibility between 5.6 and 7.0. Other stuff will be that hard to detect, that I am not sure it will be worth it. Especially some of the more subtle additions to the language will not be emaulatable. But maybe they are not worth pursuing either?