Support PHP 8.6#259
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>
nikic
left a comment
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 |
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.
There was a problem hiding this comment.
You are right. Dropped continue-on-error. The 8.6 job will now show a real (red) failure when php-src master breaks something, while fail-fast: false keeps it from cancelling the other versions.
|
Consolidated everything onto shivammathur/setup-php in a single 7.2–8.6 matrix and dropped the docker-based setup. The package.xml check that |
Test 7.2 through 8.6 with a single shivammathur/setup-php matrix instead of the docker-image based setup, which had no published php:8.6 image. 8.6 is built from php-src master; fail-fast is disabled so a failure there does not cancel the other versions. The package.xml validation previously done in ci/test_inner.sh is kept as a "pecl package" step. The now-unused ci/ docker scripts are removed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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 could not be added to the previous docker-based test matrix. CI now usesshivammathur/setup-phpfor all PHP versions (7.2–8.6) in a single matrix, replacing the docker-based setup. 8.6 is built from php-src master and markedcontinue-on-errorsince it is still in development and is a moving target. Thepackage.xmlvalidation previously run inci/test_inner.shis preserved as apecl packagestep, and the now-unusedci/docker scripts are removed.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.