dep-protobuf/php/tests
Dong Kim 32d75b6bbc [PHP] Fix locale-dependent JSON float encoding (#18808) (#25329)
This PR addresses issue #18808 regarding locale-dependent JSON serialization in PHP.

### Problem
When the system environment is set to a locale that uses a comma as a decimal separator (like `de_DE`), `float` and `double` values were being serialized into JSON as `3,14` instead of `3.14`. This produced invalid JSON that could not be parsed by other systems.

### Solution
- Updated php/src/Google/Protobuf/Internal/GPBJsonWire.php to use `sprintf("%.*h", ...)` for formatting values. This ensures that the decimal separator is always a dot (`.`), making the output locale-independent.
- Added a new test case testJsonEncodeFloatLocaleIndependent in php/tests/EncodeDecodeTest.php. This test explicitly sets the locale to `de_DE` to verify that the fix works correctly and produces valid JSON.

### Verification
- [x] Added new regression test.
- [x] Verified that all PHP tests pass locally: `vendor/bin/phpunit php/tests/EncodeDecodeTest.php`

Fixes #18808

Closes #25329

COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/25329 from khdkkhdd:18808-php-float-fix 5de303962e
PiperOrigin-RevId: 911348844
2026-05-06 08:23:01 -07:00
..
generated_previous feat: [PHP] add previous classname to descriptor pool 2022-05-31 15:21:46 -07:00
proto feat(php): support default values for editions/proto2 (#25161) 2026-01-07 17:44:16 -08:00
proto_previous feat: [PHP] add previous classname to descriptor pool 2022-05-31 15:21:46 -07:00
ArrayTest.php feat(php): Add PHP typehints for setters and remove redundant GPBUtil checks (#25296) 2026-01-15 23:44:59 -08:00
compile_extension.sh Parallelize the build of the PHP extension 2023-03-06 07:10:14 -08:00
ComposerJsonTest.php Fix signedness comparison warning (#23354) 2025-09-10 07:33:34 -07:00
DebugInfoTest.php feat: better debug info for PHP messages and repeated fields (#12718) 2023-10-17 05:30:15 -07:00
DefaultValueTest.php feat(php): support default values for editions/proto2 (#25161) 2026-01-07 17:44:16 -08:00
DescriptorsTest.php Breaking Change: Remove deprecated PHP APIs FieldDescriptor getLabel, use IsRepeated or isRequired instead. 2025-12-16 15:26:03 -08:00
EncodeDecodeTest.php [PHP] Fix locale-dependent JSON float encoding (#18808) (#25329) 2026-05-06 08:23:01 -07:00
force_c_ext.php Updated and simplified PHP testing structure (#8558) 2021-05-04 10:19:22 -07:00
gdb_test.sh Simplified PHP testing scripts. (#7574) 2020-05-28 19:24:08 -07:00
GeneratedClassTest.php [php][ext] - Handle NULL optional constructor arg (#21224) 2026-02-20 10:04:05 -08:00
GeneratedPhpdocTest.php Bump version dependencies on phpunit/phpunit to ">=11.5.0 <12.0.0" 2026-01-27 18:34:56 -08:00
MapFieldTest.php feat(php): Add PHP typehints for setters and remove redundant GPBUtil checks (#25296) 2026-01-15 23:44:59 -08:00
memory_leak_test.php Internal change 2023-09-18 15:17:56 -07:00
memory_leak_test.sh Fixed PHP SEGV when constructing messages from a destructor. 2021-09-10 16:57:59 -07:00
multirequest.php Fix Multiple Request for PHP (#7008) 2019-12-12 13:59:51 -08:00
multirequest.sh Fixed multirequest.sh script for when nohup.out does not exist. 2021-09-11 09:24:14 -07:00
PhpImplementationTest.php Pure PHP: add test that confirms high bits set in the 10th varint byte are silently discarded (except for the continuation bit which parse-fails). 2026-04-15 08:56:36 -07:00
test_base.php feat(php): Add PHP typehints for setters and remove redundant GPBUtil checks (#25296) 2026-01-15 23:44:59 -08:00
test_util.php Updated upb to pick up several bugfixes (#7740) 2020-08-07 14:44:49 -07:00
valgrind.supp Fixed PHP SEGV when constructing messages from a destructor. 2021-09-10 16:57:59 -07:00
WellKnownTest.php Bump version dependencies on phpunit/phpunit to ">=11.5.0 <12.0.0" 2026-01-27 18:34:56 -08:00
WrapperTypeSettersTest.php Bump version dependencies on phpunit/phpunit to ">=11.5.0 <12.0.0" 2026-01-27 18:34:56 -08:00