PHPackages                             endel/php-code-downgrade - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. endel/php-code-downgrade

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

endel/php-code-downgrade
========================

46277[3 issues](https://github.com/endel/php-code-downgrade/issues)PHP

Since Jan 20Pushed 10y ago5 watchersCompare

[ Source](https://github.com/endel/php-code-downgrade)[ Packagist](https://packagist.org/packages/endel/php-code-downgrade)[ RSS](/packages/endel-php-code-downgrade/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

php-code-downgrade
==================

[](#php-code-downgrade)

Tool to downgrade your PHP codebase from PHP 5.4+ to PHP 5.3. Built on top of [galapagos](https://github.com/endel/galapagos).

Consider including [php5.3-compatibility](https://github.com/packfire/php5.3-compatibility) package in your project, which includes `JsonSerializable` and `SessionHandlerInterface`.

You may have to manually fix some remaining problems, usually they're quite simple.

Why?
----

[](#why)

Use it when you have a PHP 5.4+ codebase and just can't upgrade your client's infrastructure.

Features
--------

[](#features)

- Convert new array syntax to old one. (`[1,2,3]` to `array(1,2,3)`)
- Inject traits code into classes that use them.
- Analyze every vendor's `composer.json` and convert them if it's needed
- Downgrade function calls with different signature.
    - `stream_context_create`
    - `session_set_save_handler`
- Custom node transformations

Usage
-----

[](#usage)

```
./php-code-downgrade [path-to-downgrade]

```

Using custom node transformations:

```
./php-code-downgrade [path-to-downgrade] -t transformations/phalanger

```

License
-------

[](#license)

MIT

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/9be4eac04f2b81f8077124dfbf653488512557fa5193e6d57c473d7ec9b25fd6?d=identicon)[endel](/maintainers/endel)

---

Top Contributors

[![endel](https://avatars.githubusercontent.com/u/130494?v=4)](https://github.com/endel "endel (11 commits)")

---

Tags

downgradephpphp-5

### Embed Badge

![Health badge](/badges/endel-php-code-downgrade/health.svg)

```
[![Health](https://phpackages.com/badges/endel-php-code-downgrade/health.svg)](https://phpackages.com/packages/endel-php-code-downgrade)
```

###  Alternatives

[phpmentors/workflower

A BPMN 2.0 workflow engine for PHP

71256.1k4](/packages/phpmentors-workflower)[bvdputte/kirby-autopublish

Kirby plugin to schedule the automatic publishing of pages on a certain date+time. It is built to work with enabled cache.

359.2k](/packages/bvdputte-kirby-autopublish)[nexucis/es-index-helper

Elasticsearch Index Helper for php, which allows you to manage your indices without any downtime

1519.5k](/packages/nexucis-es-index-helper)

PHPackages © 2026

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