[php-src] Issue #8201: array_unique with SORT_REGULAR flag does not always work as expected
| From: | davidjr82 | Date: | Tue, 15 Mar 2022 16:50:22 +0000 |
| Subject: | [php-src] Issue #8201: array_unique with SORT_REGULAR flag does not always work as expected | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-240346@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/8201
Author: davidjr82
### Description
The following code:
```php
<?php
print_r(array_unique(["100","100","25","15p100","25","25"],
SORT_REGULAR));
```
Resulted in this output:
```
Array
(
[0] => 100
[2] => 25
[3] => 15p100
[4] => 25
)
```
But I expected this output instead:
```
Array
(
[0] => 100
[2] => 25
[3] => 15p100
)
```
It happens because of the value "15p100", if I remove the letter "p" it works.
It happens with any character not digit (example "15+100").
### PHP Version
PHP 8.1.2
### Operating System
_No response_