[php-src] Issue #13198: Regression error in PHP8.3.2 around BOM string removal.
| From: | nyamsprod | Date: | Fri, 19 Jan 2024 20:21:18 +0000 |
| Subject: | [php-src] Issue #13198: Regression error in PHP8.3.2 around BOM string removal. | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-246294@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/13198
Author: nyamsprod
### Description
The following code:
```php
<?php
$bom = "\xFF\xFE";
$str = $bom.$bom.'john';
$removeStr = substr($str, strlen($bom));
$removeStrMb = mb_substr($str, mb_strlen($bom));
var_dump(
$removeStr === $bom.'john',
$removeStrMb === $bom.'john',
);
```
Resulted in this output:
```
bool(true)
bool(false)
```
But I expected this output instead:
```
bool(true)
bool(true)
```
Tested with https://3v4l.org/NnkoU
Is this a regression or a bug fix ?
### PHP Version
PHP 8.3.2
### Operating System
_No response_