PHPackages                             phabel/phabel - 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. phabel/phabel

ActiveComposer-plugin[Utility &amp; Helpers](/categories/utility)

phabel/phabel
=============

Write and deploy modern PHP 8 code, today.

1.0.58.81(3y ago)24560.4k9[6 issues](https://github.com/phabelio/phabel/issues)[1 PRs](https://github.com/phabelio/phabel/pulls)12MITPHPPHP &gt;=8.1 &lt;8.2

Since Aug 28Pushed 4mo ago13 watchersCompare

[ Source](https://github.com/phabelio/phabel)[ Packagist](https://packagist.org/packages/phabel/phabel)[ GitHub Sponsors](https://github.com/danog)[ RSS](/packages/phabel-phabel/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (203)Used By (12)

Phabel [![phabel.io - PHP transpiler](https://camo.githubusercontent.com/7db458d935c321a6241840a3859ab691dee73c93ec1d54f9630af51651fe07dc/68747470733a2f2f70686162656c2e696f2f6261646765)](https://phabel.io)
=============================================================================================================================================================================================================

[](#phabel-)

**Write and deploy modern PHP 8 code, today.**

This is a transpiler that allows native usage of PHP 8+ features and especially syntax in projects and libraries, while allowing maintainers to publish a version targeting lower versions of php.

The transpiler seamlessly hooks into composer to transpile the package (and all dependencies down the current branch of the dependency tree!) on installation, on the user's machine, targeting the user's specific PHP version.

Syntax/feature support:

- ✅ 8.0+
- [async/await syntax](#asyncawait-syntax)
- Psalm-compatible generics coming soon :D

Created by [Daniil Gentili](https://daniil.it)

Usage
-----

[](#usage)

```
composer require --dev phabel/phabel

```

You can now publish your packagist package, and it will be automatically transpiled to any PHP version supported by phabel.

**After git tagging a new release, just run**:

```
vendor/bin/phabel publish

```

💡 Your PHP 7 users can now install your PHP 8 library 💡
💡 **All your dependencies will also be transpiled to the correct PHP version.** 💡

Supported PHP versions
----------------------

[](#supported-php-versions)

Syntax/feature support:

- ✅ 8.0+
- [async/await syntax](#asyncawait-syntax)

Target:

- ✅ 7.1+
- 🐘 5.6, 7.0 in final testing stage.
- 💡 5.4, 5.5 support coming soon!

**No additional commands are required to add support for older versions**: just `composer update` 😄

Examples
--------

[](#examples)

### Async/await syntax

[](#asyncawait-syntax)

Phabel also supports `async/await` syntax, powered by [Amp](https://amphp.org).
Parallelize your code, using native `async/await` syntax and the [async Amp libraries](https://github.com/amphp) for fully concurrent networking, I/O, database access in pure, native PHP!

#### File I/O

[](#file-io)

This example uses the [amphp/file](https://github.com/amphp/file) library:

```
