[php-src] Issue #9969: PHP 8.1 bug, rtrim() and trim() function in PHP String manipulation
| From: | SathishKumarA2001 | Date: | Fri, 18 Nov 2022 10:00:08 +0000 |
| Subject: | [php-src] Issue #9969: PHP 8.1 bug, rtrim() and trim() function in PHP String manipulation | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-242846@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/9969
Author: SathishKumarA2001
### Description
The following code:
```php
<?php
$str = "Cardiii@gmail.com";
echo rtrim($str,"@gmail.com");
echo trim($str,"@gmail.com");
```
Resulted in this output:
```
Card
Card
```
Throws the same above output when I use "Cardaa@gmail.com", "Cardoo@gmail.com";
But I expected this output instead:
```
Cardiii
Cardiii
```
### PHP Version
PHP 8.1.2
### Operating System
Ubuntu 22.04.1