Skip to content
@true-async

PHP True Async

Implementation of native asynchrony at the PHP core level

True Asynchronous inside PHP

Imagine PHP with coroutines, where familiar functions support concurrent I/O. No colored async functions. Just do spawn() and go!

70+ standard PHP functions work non-blocking out of the box — fread, fwrite, curl, PDO, sleep and more.

DocumentationDownloadRFCDiscordDocker


What is this?

PHP True Async brings native coroutines to the PHP core — no extensions swapping out blocking functions, no framework magic. Regular PHP functions (fread, fwrite, curl, PDO, fsockopen) become non-blocking automatically inside a coroutine.

$task1 = spawn(function() {
$pdo = newPDO($dsn);
$stmt = $pdo->prepare("SELECT * FROM users WHERE id = ?");
$stmt->execute([1]); // non-blocking I/O, yields to other coroutinesreturn$stmt->fetch();
});
$task2 = spawn(function() {
$socket = fsockopen($host, 9000);
fwrite($socket, "ping"); // non-blocking, runs concurrently with $task1
});

Project Structure

RepositoryDescription
php-src true-asyncPHP core with TrueAsync API + coroutine scheduler
php-asyncExtension implementing the TrueAsync API (libuv reactor)
serverAsync Server with Http2, Http3
php-true-async-rfcRFC, design documents and rationale
releasesPre-built binaries for Linux, macOS and Windows

Get Started

Full installation instructions for Linux, macOS, Windows and Docker: → Download & Install

Full API reference and guides: → Documentation

Contributing

We welcome contributions of all kinds — code, docs, testing, and community support. → Contributing Guide


💬 Discord · 📖 Docs · 🐛 Issues

Pinned Loading

  1. php-asyncphp-asyncPublic

    The heart of asynchronous PHP, delivered as a core extension and implementing the TrueAsync ABI.

    PHP 376 7

  2. php-srcphp-srcPublic

    Forked from php/php-src

    The PHP Interpreter

    C 30

  3. serverserverPublic

    TrueAsync Server

    C 71 2

  4. true-async.github.iotrue-async.github.ioPublic

    Documentation for the PHP TrueAsync

    HTML 11 2

  5. releasesreleasesPublic

    TrueAsync PHP — pre-built binaries and installer

    Shell 18 1

  6. php-async-core-rfcphp-async-core-rfcPublic

    RFC: thin Async Core ABI for PHP (zend_async_API) — mechanism-only coroutine API with a policy-free core

    14

Repositories

Showing 10 of 37 repositories

People

This organization has no public members. You must be a member to see who’s a part of this organization.

Top languages

Loading…

Most used topics

Loading…