[GIT-PULLS] [php-src] PR #22843: ext/standard: Fix `setlocale()` NUL byte truncation

[email protected] (LamentXU123) Tue, 21 Jul 2026 09:43:43 +0000
Newsgroups php.git-pulls
Message-ID <[email protected]>
Pull Request: https://github.com/php/php-src/pull/22843
Author: LamentXU123

```php
<?php
var_dump(setlocale(LC_ALL, "C\0invalid"));
```
```
string(1) "C"
```
See: https://3v4l.org/rHId2#v
New argument logic in `try_setlocale_zval` is inevitable because we need to know the argument position when we raise the ValueError (both the second and the third parameter of the `setlocale` function have the truncation issue)