Skip to content

[BUGFIX] Fix RoundViewHelper with symfony/polyfill-php84#1373

Merged
lolli42 merged 1 commit intomainfrom
lolli-1
Apr 16, 2026
Merged

[BUGFIX] Fix RoundViewHelper with symfony/polyfill-php84#1373
lolli42 merged 1 commit intomainfrom
lolli-1

Conversation

@lolli42
Copy link
Copy Markdown
Member

@lolli42 lolli42 commented Apr 16, 2026

symfony/polyfill-php84 1.33.0->1.34.0 adds RoundingMode stub [1].

round() in PHP < 8.4 allows int as third argument only, and has been extended with php 8.4 to allow int|RoundingMode.

The 'class_exists()' check in RoundViewHelper now suddenly returns true when latest symfony/polyfill-php84 is loaded, and then feeds \RoundingMode enum to round() in php < 8.4, which fails with type error. Yay.

The patch switches to a straight version check to trigger the PHP < 8.4 callback chain avoiding RoundingMode enum altogether, to avoid the symfony/polyfill-php84 influence.

[1] symfony/polyfill-php84@e4e3f1c

symfony/polyfill-php84 1.33.0->1.34.0 adds RoundingMode stub [1].

round() in PHP < 8.4 allows int as third argument only, and
has been extended with php 8.4 to allow int|RoundingMode.

The 'class_exists()' check in RoundViewHelper now suddenly
returns true when latest symfony/polyfill-php84 is loaded,
and then feeds \RoundingMode enum to round() in php < 8.4,
which fails with type error. Yay.

The patch switches to a straight version check to trigger
the PHP < 8.4 callback chain avoiding RoundingMode enum
altogether, to avoid the symfony/polyfill-php84 influence.

[1] symfony/polyfill-php84@e4e3f1c
@lolli42 lolli42 merged commit 28c42c7 into main Apr 16, 2026
10 checks passed
@lolli42 lolli42 deleted the lolli-1 branch April 16, 2026 17:09
lolli42 added a commit that referenced this pull request Apr 16, 2026
symfony/polyfill-php84 1.33.0->1.34.0 adds RoundingMode stub [1].

round() in PHP < 8.4 allows int as third argument only, and
has been extended with php 8.4 to allow int|RoundingMode.

The 'class_exists()' check in RoundViewHelper now suddenly
returns true when latest symfony/polyfill-php84 is loaded,
and then feeds \RoundingMode enum to round() in php < 8.4,
which fails with type error. Yay.

The patch switches to a straight version check to trigger
the PHP < 8.4 callback chain avoiding RoundingMode enum
altogether, to avoid the symfony/polyfill-php84 influence.

[1] symfony/polyfill-php84@e4e3f1c
lolli42 added a commit that referenced this pull request Apr 16, 2026
symfony/polyfill-php84 1.33.0->1.34.0 adds RoundingMode stub [1].

round() in PHP < 8.4 allows int as third argument only, and
has been extended with php 8.4 to allow int|RoundingMode.

The 'class_exists()' check in RoundViewHelper now suddenly
returns true when latest symfony/polyfill-php84 is loaded,
and then feeds \RoundingMode enum to round() in php < 8.4,
which fails with type error. Yay.

The patch switches to a straight version check to trigger
the PHP < 8.4 callback chain avoiding RoundingMode enum
altogether, to avoid the symfony/polyfill-php84 influence.

[1] symfony/polyfill-php84@e4e3f1c
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.

3 participants