PHPackages                             ion/php-trans-porter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. ion/php-trans-porter

ActiveLibrary

ion/php-trans-porter
====================

A PHP command-line utility and class library to convert source code between PHP 5.6 / 7.0 / 7.1 / 7.2.

v0.1.3+main(2y ago)01.1k1proprietaryPHPPHP ^5.6|^7.0|^8.0

Since Apr 1Pushed 2y agoCompare

[ Source](https://github.com/ion-digital/ion-php-trans-porter)[ Packagist](https://packagist.org/packages/ion/php-trans-porter)[ Docs](https://github.com/ion-digital/ion-php-trans-porter)[ RSS](/packages/ion-php-trans-porter/feed)WikiDiscussions main Synced 3d ago

READMEChangelogDependencies (3)Versions (7)Used By (1)

### PHP Trans-Porter

[](#php-trans-porter)

[![License: LGPL v3](https://camo.githubusercontent.com/5432664fccb6cb004464a3cd4c53970d52daa9dbb7714aaaa92ca30d1f3742f0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4c47504c25323076332d626c75652e737667)](https://www.gnu.org/licenses/lgpl-3.0)

PHP Trans-Porter is a small utility that trans-ports (get it...?) source code from one PHP version to be used in another.

As someone that does freelance work from time to time, but has a limited amount of it, I became really frustrated with clients' hosting requirements varying between the different PHP versions available (PHP 5.6 to PHP 7.1 and up), and not being able to use new language features (e.g. scalar type hinting) and the potential performance benefits they provide.

Since its sometimes not possible for a client to update their hosted version of PHP (due to multiple, but *sometimes* questionable reasons :) ), I needed to find a way to stream-line my work-flow so that:

- I could waste less time trying to convince my clients to upgrade or change hosts,
- use the newest PHP language features,
- and spend less time explaining version-specific bugs that pop up every-so-often, when you're juggling versions.

Features
--------

[](#features)

PHP Trans Porter currently features back-porting for PHP versions 5.6, 7.x (7.0 to 7.2), as well as bulk transformations (specify an input directory and an output directory, and all **.php** files will be converted recursively).

The utility tries to make the least amount of changes possible, but with the goal of generating source code that should not have to be modified again.

The current base version is: *PHP 8.2*.

Conversion features for PHP *7.3* and above:

- *None* (yet!)

Conversion features for PHP *7.2* to PHP *7.1*:

- Remove instances of the 'object' type from return type-hints, as well as from parameter type-hints and casts.
- Remove scope modifiers (private, protected or public) from class constant definitions.

Conversion features for PHP *7.1* to PHP *7.0*:

- Remove instances of the 'void' return type.
- Remove instances of nullable returns types (e.g. '?int'), as well as from parameter type-hints.

Conversion features for PHP *7.0* to PHP *5.6*:

- Remove all scalar type-hints ('bool,' 'float,' 'string' and 'int') from return- and parameter type-hints.
- Include a 'use' statement that references '\\Exception' aliased as 'Throwable.'

All conversions stack up - thus, converting from PHP 7.2 to PHP 5.6, will first it to 7.1, then 7.0 and finally 5.6.

Getting Started
---------------

[](#getting-started)

\###Using Composer:

Make sure Composer is installed - if not, you can get it from [here](https://getcomposer.org/ "getcomposer.org").

First, you need to add *ion/php-trans-porter* as a dependency in your *composer.json* file.

To use the current stable version, add the following to download it straight from [here](https://packagist.org/ "packagist.org"):

```
"require": {
    "php": ">=8.2",
    "ion/php-trans-porter": "^0.1",
}

```

To use the bleeding edge (development) version, add the following:

```
"require": {
    "php": ">=8.2",
    "ion/php-trans-porter": "dev-default",
},
"repositories": {
    {
      "type": "vcs",
      "url": "https://github.com/ion-digital/ion-php-trans-porter"
    }
}

```

Then run the following in the root directory of your project:

> php composer.phar install

### Prerequisites

[](#prerequisites)

- PHP (available on the command-line)
- Composer

Built With
----------

[](#built-with)

- [Composer](https://getcomposer.org/) - Dependency Management
- [PHP Parser](https://packagist.org/packages/nikic/php-parser/) - Thanks to Nikita Popov for the excellent PHP Parser library!
- [NetBeans](https://www.netbeans.org) - IDE

Versioning
----------

[](#versioning)

We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://https://github.com/ion-digital/ion-php-trans-porter/tags "bitbucket.org").

Authors
-------

[](#authors)

- **Justus Meyer** - *Initial work* - [GitHub](https://justusmeyer.com/github), [Upwork](https://justusmeyer.com/upwork)

License
-------

[](#license)

This project is licensed under the LGPL-3.0 License - see the [LICENSE.md](LICENSE.md) file for details.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 57.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~232 days

Total

5

Last Release

941d ago

PHP version history (3 changes)v0.0.20PHP ^7.1.3

v0.1.1PHP ^8.2

v0.1.2+mainPHP ^5.6|^7.0|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/d1447490b5fa8bc0cd0e9d57a840fe060bd1f7c6e5156e7c4a3c0479d22793e1?d=identicon)[Jus](/maintainers/Jus)

---

Top Contributors

[![vl-justus-meyer](https://avatars.githubusercontent.com/u/92323513?v=4)](https://github.com/vl-justus-meyer "vl-justus-meyer (4 commits)")[![jmeyer-ion](https://avatars.githubusercontent.com/u/42908068?v=4)](https://github.com/jmeyer-ion "jmeyer-ion (3 commits)")

---

Tags

phptransporterphp 7.0php 7.1php 7.2PHP 5.6php convertersource converterback-porterbackportertrans porterphp trans porterphp transporter

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ion-php-trans-porter/health.svg)

```
[![Health](https://phpackages.com/badges/ion-php-trans-porter/health.svg)](https://phpackages.com/packages/ion-php-trans-porter)
```

###  Alternatives

[vimeo/psalm

A static analysis tool for finding errors in PHP applications

5.8k77.5M6.7k](/packages/vimeo-psalm)[danog/madelineproto

Async PHP client API for the telegram MTProto protocol.

3.4k855.0k18](/packages/danog-madelineproto)[salmanzafar/laravel-mqtt

A simple Laravel Library to connect/publish/subscribe to MQTT broker

106153.1k1](/packages/salmanzafar-laravel-mqtt)[pestphp/pest-plugin-drift

The Pest Drift Plugin

734.0M74](/packages/pestphp-pest-plugin-drift)[salmanzafar/laravel-geocode

A Laravel Library to find Lat and Long of a given Specific Address

153.9k](/packages/salmanzafar-laravel-geocode)[corveda/php-sandbox

A PHP library that can be used to run PHP code in a sandboxed environment

23483.5k2](/packages/corveda-php-sandbox)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
