Skip to content

Conversation

@yoeunes
Copy link
Contributor

@yoeunes yoeunes commented Nov 9, 2025

Q A
Branch? 6.4
Bug fix? yes
New feature? no
Deprecations? no
Issues -
License MIT

This PR suggests replacing the setlocale() logic in Compiler::repr() with var_export() when compiling numbers.

The current use of setlocale() is not thread-safe and can cause race conditions in concurrent environments (e.g., Swoole, RoadRunner).

var_export() is locale-independent, thread-safe, and correctly handles all required float formats (3.3, 42.0, 1.0E-6, INF, NAN), as confirmed by the expanded test suite.

@nicolas-grekas
Copy link
Member

Thank you @yoeunes.

@nicolas-grekas nicolas-grekas merged commit e4c32e0 into symfony:6.4 Nov 12, 2025
10 of 11 checks passed
This was referenced Nov 13, 2025
This was referenced Dec 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants