Stdlib: gate PHP_ROUND_CEILING/FLOOR/TOWARD_ZERO/AWAY_FROM_ZERO on profile ≥8.4 (#22785) - #22799
Merged
Merged
Conversation
…ofile ≥8.4 (#22785) Match Zend: these modes are PHP 8.4+ only. defined()/ConstFetch now use StdlibConstants::coreIntByName() (same gate as RoundingMode / ARRAY_PAD_*), so PROFILE=8.2 and the 8.4.0-dev reference harness leave them undefined while internal VmRound still has the int values. Co-authored-by: Cursor <cursoragent@cursor.com>
4 tasks
Owner
Author
|
Cleanup bot: deleted leftover remote branch |
81 tasks
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.
Summary
PHP_ROUND_CEILING/FLOOR/TOWARD_ZERO/AWAY_FROM_ZERObehindCompilerVersion::supportsRoundingModeEnum()via newStdlibConstants::coreIntByName()(also consolidates the existingARRAY_PAD_*fetch gate).defined()/ ConstFetch / compile-time fold / JIT helper /get_defined_constantsstandard bucket honor the gate; internalVmRoundstill uses the int class constants.php-src:
ext/standard/php_math_round_mode.h,basic_functions.stub.php(RoundingMode / round modes, 8.4+).Test plan
PHP_COMPILER_PROFILE=8.2 php bin/vm.php test/repro/issue_22785_php_round_mode_profile82.php→ CEILING/FLOOR/… =0, HALF_UP=1PHP_COMPILER_PROFILE=8.4→ all four defined;round(1.1, 0, PHP_ROUND_CEILING) === 2.0bin/compile.php+ run under PROFILE=8.2/8.4 fordefined('PHP_ROUND_CEILING')vendor/bin/phpunit --filter 'php_round_mode_constants|PhpRoundModeConstantsTest'→ OK (9 tests)php script/bootstrap-inventory.php --check→ OK 6508/6508Verification transcript
Note: AOT fixtures assert
defined()+ constant values only — nativeround()AOT currently segfaults/miscompiles independently of this gate (pre-existing).Made with Cursor