Support PHP 8.6#259
Open
rlerdorf wants to merge 2 commits into
Open
Conversation
Add compatibility shims in php_ast.h for the internal Zend API changes in PHP 8.6 (8.6.0-dev): - ZEND_AST_METHOD_REFERENCE was renamed to ZEND_AST_TRAIT_METHOD_REFERENCE - The _throw() ZPP variants were removed; plain ZPP now always throws, so zend_parse_parameters_throw maps to zend_parse_parameters and the removed ZEND_PARSE_PARAMS_THROW flag is defined to 0 (the throwing default). All guarded on PHP_VERSION_ID >= 80600, so older versions are unaffected and the userland ast\AST_METHOD_REFERENCE constant is unchanged. Also add tests/php86_param_doc_comments.phpt covering the one new 8.6 language feature that affects the AST: doc comments on function parameters. The docComment child of AST_PARAM (previously always null) is now populated by the parser, matching ReflectionParameter::getDocComment(). No extension changes are required for it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There is no published php:8.6 docker image yet, so 8.6 cannot be added to the existing docker-based test matrix. Add a separate job using shivammathur/setup-php, which provides an 8.6 build compiled from php-src master. The job is marked continue-on-error since 8.6 is still in development and is a moving target. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
nikic
reviewed
Jun 20, 2026
nikic
left a comment
Owner
There was a problem hiding this comment.
This looks fine to me, but I wonder if it wouldn't make sense to just use shivammathur/setup-php for all PHP versions, instead of having two different CI setups?
| # development. | ||
| build-nightly: | ||
| runs-on: ubuntu-latest | ||
| continue-on-error: true |
Owner
There was a problem hiding this comment.
I'd prefer to not continue on error. Better to ignore the error than not see it at all.
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.
Support PHP 8.6
Add compatibility shims in php_ast.h for the internal Zend API changes in PHP 8.6:
ZEND_AST_METHOD_REFERENCEwas renamed toZEND_AST_TRAIT_METHOD_REFERENCE_throw()ZPP variants were removed; plain ZPP now always throws, sozend_parse_parameters_throwmaps tozend_parse_parametersand the removedZEND_PARSE_PARAMS_THROWflag is defined to0(the throwing default).All guarded on
PHP_VERSION_ID >= 80600, so older versions are unaffected and the userlandast\AST_METHOD_REFERENCEconstant is unchanged.New 8.6 feature: doc comments on parameters
Of the implemented PHP 8.6 RFCs, only Add DocComments for function parameters is a parser change that affects the AST; the rest are library functions, new built-in enums, and reflection/runtime/ini/stream changes that don't touch the parse tree.
AST_PARAMalready has adocCommentchild (index 4), which was alwaysnullbefore 8.6. It is now populated by the parser for parameters carrying a doc comment, with no extension changes required. The output matches the engine's ownReflectionParameter::getDocComment()(including the before-vs-after-parameter comment behavior), and older AST versions are unaffected.tests/php86_param_doc_comments.phptis added as a version-gated regression test (skips on PHP < 8.6), covering doc comments on both function parameters and property-hook parameters.CI
There is no published
php:8.6docker image yet, so 8.6 cannot be added to the existing docker-based test matrix. A separatebuild-nightlyjob is added usingshivammathur/setup-php, which provides an 8.6 build compiled from php-src master. It is markedcontinue-on-errorsince 8.6 is still in development and is a moving target.Testing
Built against PHP 8.6.0-dev and ran the full suite: 95 passed, 0 failed, 2 skipped (the skipped tests are version-gated). The build and existing tests continue to pass on earlier PHP versions.