[php-src] Issue #11657: different behavior in `php -r` and php file with same code
| From: | hongweipeng | Date: | Mon, 10 Jul 2023 10:33:11 +0000 |
| Subject: | [php-src] Issue #11657: different behavior in `php -r` and php file with same code | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-244926@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/11657
Author: hongweipeng
### Description
The following code:
```php
<?php
var_dump(password_verify(md5('Mochat@urthink123.' . '3S6ybWbdy&23fFeq8'),
'$2y$10$m.FcHAE18o6W8J1F7/5Bde3ZXX33LuePI4vy2Xdnplc4Amtg9WHjm'));
```
and run in shell command:
```
php -r "var_dump(password_verify(md5('Mochat@urthink123.' .
'3S6ybWbdy&23fFeq8'),
'$2y$10$m.FcHAE18o6W8J1F7/5Bde3ZXX33LuePI4vy2Xdnplc4Amtg9WHjm'));"
```
Resulted in this output:
```
bool(true)
bool(false)
```
But I expected this output instead:
```
bool(true)
bool(true)
```

### PHP Version
8.0.21
### Operating System
_No response_