OpenSwoole 26.2.0 released with PHP 8.5 support

OpenSwoole Team
Published:

OpenSwoole 26.2.0 is a major release with PHP 8.5 support, native PHP Fiber coroutine context, io_uring reactor backend, Xdebug step debugging inside coroutines, event loop lag metrics and more.

Official OpenSwoole version 26.2.0Official OpenSwoole version 26.2.0

You can upgrade to OpenSwoole v26.2.0 now:

pecl install openswoole-26.2.0

Or use Docker images:

docker pull openswoole/openswoole:26.2-php8.5-alpine

Find more OpenSwoole docker images at OpenSwoole Docker images at Docker Hub

New Features

PHP 8.5 Support

OpenSwoole 26.2.0 is fully compatible with PHP 8.5, including new features like the Pipe Operator, URI extension, Clone With and more.

PHP Native Fiber Coroutine Context

A new coroutine context backend using PHP's native zend_fiber API instead of Boost ASM or ucontext. This enables proper integration with Xdebug, profilers, and fiber-aware extensions. See the Fiber Context documentation for examples. Configure at runtime:

Co::set(['use_fiber_context' => true]);

Or via INI: openswoole.use_fiber_context=On

Xdebug Step Debugging Inside Coroutines

Xdebug step debugging now works correctly inside coroutines when fiber context is enabled. The legacy "extremely dangerous" warning has been removed.

Runtime Reactor Type Selection

Select the event reactor backend at runtime. See the Reactor Type documentation for details and examples.

Co::set(['reactor_type' => OPENSWOOLE_IO_URING]);

New constants: OPENSWOOLE_EPOLL, OPENSWOOLE_KQUEUE, OPENSWOOLE_POLL, OPENSWOOLE_SELECT, OPENSWOOLE_IO_URING

io_uring Reactor Backend

A new event reactor using Linux io_uring with IORING_OP_POLL_ADD as a drop-in replacement for epoll. Enable with --enable-io-uring (requires liburing). Supports multishot poll on kernel 5.13+ with automatic fallback on older kernels. See the io_uring documentation for setup and examples.

io_uring Async File I/O Engine

Dedicated io_uring ring for asynchronous file operations (open, read, write, fstat, fsync, unlink, rename, mkdir, rmdir), replacing the thread pool. Unsupported operations gracefully fall back to the thread pool. See the io_uring Async File I/O documentation for examples.

Event Loop Lag Metrics

Real-time event loop lag monitoring via $server->stats(). Exposes event_loop_lag_ms, event_loop_lag_max_ms, and event_loop_lag_avg_ms per worker, task worker (when coroutine-enabled), and reactor thread (process mode). Useful for detecting blocking operations that stall the event loop. See the Event Loop Lag Metrics documentation for monitoring and alerting examples.

Coroutine-safe exit() Support

On PHP 8.4+, exit() calls inside coroutines are intercepted and throw openswoole_exit_exception instead, preventing the entire process from terminating. See the Coroutine-safe exit() documentation for examples.

HTTP Parser Migration to llhttp

Replaces the custom openswoole_http_parser with llhttp parser for improved standards compliance and performance.

Bug Fixes

  • Fix reflection issues and scope leaks (#284): OSW_FUNCTION_ALIAS caused global functions to appear as class methods with corrupted return types in Reflection. Replaced with proper PHP_FE/PHP_FALIAS entries
  • Fix file I/O hanging under io_uring: race condition where eventfd notification could be lost between draining and re-arming single-shot POLL_ADD
  • Fix file lock bug: non-blocking flock (LOCK_NB) now properly checks in-process coroutine lock state before the system flock() call
  • Fix CPU affinity compile check: add missing _GNU_SOURCE define before sched.h
  • Fix futex compile check: add missing _GNU_SOURCE define before linux/futex.h

Breaking Changes

  • Dropped PHP 8.2 support (minimum PHP 8.3 required)
  • Removed PHP < 8.0 compatibility code
  • Namespace normalization: openswoole_*

Upgrade

If you need to install OpenSwoole or look at other update methods, checkout the installation documentation and how to update Open Swoole.

Install the core library:

composer require openswoole/core:26.2.0

Thanks to the OpenSwoole Community Contributors