Skip to content

fix: Strip gzip-compressed output from concurrent process response#59224

Merged
taylorotwell merged 1 commit intolaravel:12.xfrom
NikhiltGhalme:fix/concurrency-zlib-output-compression
Mar 16, 2026
Merged

fix: Strip gzip-compressed output from concurrent process response#59224
taylorotwell merged 1 commit intolaravel:12.xfrom
NikhiltGhalme:fix/concurrency-zlib-output-compression

Conversation

@NikhiltGhalme
Copy link
Contributor

When zlib.output_compression is enabled in PHP, the child process
appends gzip-compressed binary data (magic bytes \x1f\x8b) to stdout
after the serialized JSON payload. This corrupts json_decode, which
returns null and triggers an "array offset on null" error on the
parent side.

Detect the gzip magic bytes in the child process output and truncate
before decoding. This is non-intrusive — no configuration changes are
required from the user, and unaffected environments see zero behavior
change.

Fixes #59112

  When `zlib.output_compression` is enabled in PHP, the child process
  appends gzip-compressed binary data (magic bytes \x1f\x8b) to stdout
  after the serialized JSON payload. This corrupts `json_decode`, which
  returns null and triggers an "array offset on null" error on the
  parent side.

  Detect the gzip magic bytes in the child process output and truncate
  before decoding. This is non-intrusive — no configuration changes are
  required from the user, and unaffected environments see zero behavior
  change.

  Fixes laravel#59112
@taylorotwell taylorotwell merged commit f895c1d into laravel:12.x Mar 16, 2026
22 of 72 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Concurrency::run fails silently if zlib.output_compression is turned on

2 participants