Repository navigation
Support PHP 8.2 in the Turbo extension - #6825
Merged
Merged
Conversation
ondrejmirtes
force-pushed
the
turbo-php82
branch
2 times, most recently
from
October 24, 2026 20:52
70ca7bb to
85d45c4
Compare
The shared core built against PHP 8.5 headers loads on PHP 8.2 next to a thin 8.2 extension; the shared-core gate reports identical shared code for 8.2 through 8.6. What 8.2 lacks or spells differently is routed through pt_abi or pinned in abi.h: - no engine C stack limit: Abi.cpp computes the bounds like 8.3 does and keeps them across fresh-stack coroutines - zend_fcall_info_cache.closure: 8.3's layout is declared on top of 8.2's - the literal-name arginfo bit is translated to the plain name bit - zend_zval_value_name() routes to zend_zval_type_name() on 8.2 - codegen pins for zend_string_*, smart_str_extract, ZEND_HASH_FILL_* and ZEND_ASSUME CI builds and tests 8.2 everywhere 8.3 is built; Alpine 3.24 has no php82 package, so the musl legs build it from the tarball. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0156KuUPxcWUY7jap6uxnA5h
ondrejmirtes
force-pushed
the
turbo-php82
branch
from
October 24, 2026 21:01
85d45c4 to
f5beb25
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds PHP 8.2 to the Turbo extension's supported versions without changing the shared-core split. The shared core is still compiled once against PHP 8.5 headers; on 8.2 it loads next to a thin 8.2 extension (
main.cpp,Abi.cpp,Shadow.cpp,TrustedTypes.cpp). The shared-core gate reports identical shared code for 8.2, 8.3, 8.4 and 8.6 against the 8.5 reference.What 8.2 lacks or spells differently
Each difference is either routed through
pt_abior pinned inabi.h:EG(stack_base/limit),zend_call_stack.hare new in 8.3)Abi.cppcomputes the stack bounds the way 8.3 does (Linux, macOS, Windows) and keeps them correct across fresh-stack coroutines; the shared code reads them throughpt_abi.eg_stack_*zend_fcall_info_cache.closure(8.3 grew the struct from 32 to 40 bytes)closure_ZEND_TYPE_LITERAL_NAME_BITin internal arginfoAbi.cppconverts it to the plain name bit at registrationzend_zval_value_name()is not exported in 8.2zend_zval_type_name(), so native TypeErrors use 8.2's wording ("bool given" rather than "true given")zend_string_*helpers,smart_str_extract,ZEND_HASH_FILL_*bookkeeping,ZEND_ASSUMEZ_EXPECTED_NUMBER_OR_STRING, non-constzend_parse_arg_*_slow, bool-returningzend_fiber_init_context#ifs in the version-specificAbi.cppCI and packaging
phar.yml, plus the shared-core gate (8.2and8.2-zts) and theturbo-build-image.ymltags. Windows builds 8.2 with VS16, like 8.3.install-alpine-php.shbuilds it from the tarball.TurboExtensionSelector::MINIMUM_PHP_VERSION_IDis now80200;turbo-ext/composer.jsonand the README are updated.type-family.phpreads its 8.3-only fixtures through static analysis.walk-trace.phpskips the endless-recursion fixture there, because 8.2 has no stack limit and plain PHP segfaults on it; with turbo, the native side throws the "Maximum call stack size" error.Verified locally (Linux arm64 in Docker, plus macOS)
make lint-turbois clean.The
gnu-php8.2andgnu-php8.2-ztsimages were published by runningturbo-build-image.yml(workflow_dispatch) on this branch before opening the PR.🤖 Generated with Claude Code
https://claude.ai/code/session_0156KuUPxcWUY7jap6uxnA5h