[php-src] Issue #18823: setlocale's 2nd and 3rd argument ignores strict_types
| From: | divinity76 | Date: | Tue, 10 Jun 2025 14:24:55 +0000 |
| Subject: | [php-src] Issue #18823: setlocale's 2nd and 3rd argument ignores strict_types | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-250231@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/18823
Author: divinity76
### Description
The following code:
```php
<?php
declare(strict_types=1);
try{
setlocale(LC_ALL, 0,"0"); // 2nd argument is a strict_types violation
}finally{
setlocale(LC_ALL, "0",0); // 3rd argument is a strict_types violation
}
```
Resulted in this output:
```
```
But I expected this output instead:
```
Uncaught TypeError: setlocale(): Argument #2 ($locales) must be of type string, int given in
/in/dqfQT:4
Uncaught TypeError: setlocale(): Argument #3 ($rest) must be of type string, int given in
/in/dqfQT:4
```
### PHP Version
```plain
PHP8.4.8
```
### Operating System
WSL Ubuntu 24.04