Skip to content

Commit ad25595

Browse files
committed
Revert changes which are PHP 8 only
1 parent 303c7f8 commit ad25595

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Preg.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public static function matchAll($pattern, $subject, &$matches = null, $flags = 0
7878
}
7979

8080
$result = preg_match_all($pattern, $subject, $matches, $flags, $offset);
81-
if ($result === false) {
81+
if ($result === false || $result === null) {
8282
throw PcreException::fromFunction('preg_match_all', $pattern);
8383
}
8484

@@ -100,7 +100,7 @@ public static function matchAll($pattern, $subject, &$matches = null, $flags = 0
100100
public static function matchAllWithOffsets($pattern, $subject, &$matches, $flags = 0, $offset = 0)
101101
{
102102
$result = preg_match_all($pattern, $subject, $matches, $flags | PREG_OFFSET_CAPTURE, $offset);
103-
if ($result === false) {
103+
if ($result === false || $result === null) {
104104
throw PcreException::fromFunction('preg_match_all', $pattern);
105105
}
106106

0 commit comments

Comments
 (0)