[php-src] Issue #8021: preg_match return false on a long string without warning or notice
| From: | PawelBichalski | Date: | Wed, 02 Feb 2022 08:40:07 +0000 |
| Subject: | [php-src] Issue #8021: preg_match return false on a long string without warning or notice | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-239420@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/8021
Author: PawelBichalski
### Description
The following code:
```php
<?php
error_reporting(E_ALL);
$regex = '/^\d+(?:(?:,\d+)+|:\d+)$/';
echo "range 1 - 8192\n";
var_dump(preg_match($regex, implode(',', range(1, 8192))));
echo "range 1 - 8193\n";
var_dump(preg_match($regex, implode(',', range(1, 8193))));
```
Resulted in this output:
```
range 1 - 8192
int(1)
range 1 - 8193
bool(false)
```
But I expected this output instead:
```
range 1 - 8192
int(1)
range 1 - 8193
bool(1) or notice message
```
http://sandbox.onlinephpfunctions.com/code/b5a6921f9b5beef87fee5bb6c25a359ba8b76702
### PHP Version
8.0
### Operating System
_No response_