Download Latest Version 4.24.0 source code.tar.gz (121.1 kB)
Email in envelope

Get an email when there's a new version of Sentry PHP

Home / 4.21.0
Name Modified Size InfoDownloads / Week
Parent folder
4.21.0 source code.tar.gz 2026-02-24 115.4 kB
4.21.0 source code.zip 2026-02-24 183.4 kB
README.md 2026-02-24 1.1 kB
Totals: 3 Items   299.9 kB 0

The Sentry SDK team is happy to announce the immediate availability of Sentry PHP SDK v4.21.0.

Features

  • Add RuntimeContext and context lifecycle helpers for long-lived runtimes such as FrankenPHP and RoadRunner. (#2011)

Long-lived worker runtimes keep process memory between requests, which can cause scope data to leak from one request to the next. RuntimeContext isolates SDK state per request and flushes buffered telemetry when the request context ends. Data configured before a runtime context is started is copied into each new context as baseline scope data.

Example:

:::php
\Sentry\init([
    'dsn' => '__YOUR_DSN__',
]);

$handler = static function (): void {
    \Sentry\withContext(static function (): void {
        // Handle one request.
    });
};

while (frankenphp_handle_request($handler)) {}

When using a runtime context, manual \Sentry\flush() calls are not needed for request teardown. It is still necessary to finish transactions explicitly.

Source: README.md, updated 2026-02-24