janpiet/php-version-transpiler

Transpile php 7 code to php 5.6 code

dev-master 2016-12-20 14:38 UTC

This package is auto-updated.

Last update: 2024-10-20 22:47:15 UTC


README

Scrutinizer Code Quality Code Coverage Build Status | Latest Stable Version Latest Unstable Version License Monthly Downloads

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?

From http://php.net/manual/de/migration70.new-features.php

From http://php.net/manual/de/migration70.incompatible.php