[php-src] Issue #13823: levenshtein bug
| From: | MyNameIsRoman | Date: | Thu, 28 Mar 2024 05:48:14 +0000 |
| Subject: | [php-src] Issue #13823: levenshtein bug | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-246660@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/13823
Author: MyNameIsRoman
### Description
The following code:
```php
<?php
echo levenshtein('aa', 'ab', 1, PHP_INT_MAX, 1);
```
Resulted in this output:
```
-9223372036854775807
```
But I expected this output instead:
```
2
```
Also levenshtein(str_repeat('a', 100000), str_repeat('b', 1000000), 1,
PHP_INT_MAX - 500000, 1)
returning unexpected -9223372036854625811
### PHP Version
any
### Operating System
any