[php-src] Issue #15824: ValueError: mb_detect_encoding(): Argument #2 ($encodings) contains invalid encoding "UTF8"
| From: | nicolas-grekas | Date: | Tue, 10 Sep 2024 10:39:36 +0000 |
| Subject: | [php-src] Issue #15824: ValueError: mb_detect_encoding(): Argument #2 ($encodings) contains invalid encoding "UTF8" | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-247742@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/15824
Author: nicolas-grekas
### Description
The following code: https://3v4l.org/3cnGD/rfc#vgit.master
```php
<?php
echo mb_detect_encoding('abc', 'UTF8, ASCII');
```
Resulted in this output:
```
Fatal error: Uncaught ValueError: mb_detect_encoding(): Argument #2 ($encodings) contains invalid
encoding "UTF8"
```
But I expected this output instead:
```
UTF-8
```
This is a regression, see https://3v4l.org/3cnGD
And this works if the list is given as an array: https://3v4l.org/lVva0/rfc#vgit.master
### PHP Version
PHP 8.4
### Operating System
_No response_