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.

Documentation Download RFC Discord Docker


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 = new PDO($dsn);
    $stmt = $pdo->prepare("SELECT * FROM users WHERE id = ?");
    $stmt->execute([1]);       // non-blocking I/O, yields to other coroutines
    return $stmt->fetch();
});

$task2 = spawn(function() {
    $socket = fsockopen($host, 9000);
    fwrite($socket, "ping");   // non-blocking, runs concurrently with $task1
});

Project Structure

Repository Description
php-src true-async PHP core with TrueAsync API + coroutine scheduler
php-async Extension implementing the TrueAsync API (libuv reactor)
php-true-async-rfc RFC, design documents and rationale
releases Pre-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-async php-async Public

    PHP Async extension

    PHP 221 4

  2. php-true-async-rfc php-true-async-rfc Public

    Forked from EdmondDantes/php-true-async-rfc

    PHP TRUE ASYNC RFC

    63 2

  3. php-src php-src Public

    Forked from php/php-src

    The PHP Interpreter

    C 22

  4. true-async.github.io true-async.github.io Public

    Documentation for the PHP TrueAsync

    HTML 3 1

Repositories

Showing 10 of 17 repositories

People

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

Most used topics

Loading…