-1
Daily
9,085
stars
707
forks
356
watchers
264
prs
213
issues
23
releases
README
Event-driven, non-blocking I/O with PHP.
ReactPHP is a low-level library for event-driven programming in PHP. At its core
is an event loop, on top of which it provides low-level utilities, such as:
Streams abstraction, async DNS resolver, network client/server, HTTP
client/server and interaction with processes. Third-party libraries can use these
components to create async network clients/servers and more.
php
listen($socket);
echo "Server running at http://127.0.0.1:8080" . PHP_EOL;
This simple web server written in ReactPHP responds with "Hello World!" for every request.
ReactPHP is production ready and battle-tested with millions of installations
from all kinds of projects around the world. Its event-driven architecture makes
it a perfect fit for efficient network servers and clients handling hundreds or
thousands of concurrent connections, long-running applications and many other
forms of cooperative multitasking with non-blocking I/O operations. What makes
ReactPHP special is its vivid ecosystem with hundreds of third-party libraries
allowing you to integrate with many existing systems, such as common network
services, database systems and other third-party APIs.
Production ready and battle-tested.
Rock-solid with stable long-term support (LTS) releases.
Requires no extensions and runs on any platform - no excuses!
Takes advantage of optional extensions to get better performance when available.
Highly recommends latest version of PHP 7+ for best performance and support.
Supports legacy PHP 5.3+ and HHVM for maximum compatibility.
Well designed and reusable components.
Decoupled parts so they can be replaced by alternate implementations.
Carefully tested (unit & functional).
Promotes standard PSRs where possible for maximum interoperability.
Aims to be technology neutral, so you can use your preferred application stack.
Small core team of professionals supported by large network of outside contributors.
ReactPHP is non-blocking by default. Use workers for blocking I/O.
The event loop is based on the reactor pattern (hence the name) and strongly
inspired by libraries such as EventMachine (Ruby), Twisted (Python) and
Node.js (V8).
This repository you're currently looking at is mostly used as a meta
repository to discuss and plan all things @ReactPHP. See the individual
components linked below for more details about each component, its
documentation and source code.
Core Components
EventLoop
ReactPHP's core reactor event-loop.
Read the documentation
Stream
Event-driven readable and writable streams for non-blocking I/O in ReactPHP.
Read the documentation
Promise
Promises/A implementation for PHP.
Read the documentation
Async
Async utilities and fibers for ReactPHP.
Read the documentation
Network Components
Socket
Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP.
Read the documentation
Datagram
Event-driven UDP client aDiscussions
#624Released reactphp/http `v1.12.0`0 comments · 2026-11-03#621Released reactphp/http `v1.11.1`0 comments · 2026-09-09#620When will v3 for most react components will be finish?1 comments · 2026-04-22#619Example: Querying HTTPS DNS records (type 65) with ReactPHP DNS0 comments · 2026-03-10#618HTTP/2 client and server examples using ReactPHP and an nghttp2 PHP extension0 comments · 2026-03-10#617Accessing negotiated ALPN protocol from ReactPHP Socket0 comments · 2026-03-07#616Minimal HTTP/2 client example using react/socket1 comments · 2026-03-06#615Potential Issue with Simultaneous Requests Using a Single HTTP Client Instance2 comments · 2026-02-10
Latest release
v1.4.0 v1.4.0 2023-07-11A major new feature release, see release announcement.
Feature: Add support for new Promise v3 release.
(464 and 524 by @clue)
Feature: Support PHP 8.2 release.
(491 by @Nielsvanpach)
Improve test suite, update dependencies and report failed assertions.
(462 and 501 by @clue and 466 and 492 by @SimonFrings)