Skip to content

Commit caef944

Browse files
committed
review: replaced optional Filter dependency in OOM worker detection
1 parent 3272a14 commit caef944

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Zend/tests/new_oom.phpt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ function getOomProcessCount(): int
1717
return 1;
1818
}
1919

20-
$processCount = filter_var(trim($processCount), FILTER_VALIDATE_INT, [
21-
'options' => ['min_range' => 1],
22-
]);
23-
24-
return $processCount === false ? 1 : min($processCount, 4);
20+
$processCount = trim($processCount);
21+
if (preg_match('/^[1-9][0-9]*$/D', $processCount) !== 1) {
22+
return 1;
23+
}
24+
return min((int) $processCount, 4);
2525
}
2626

2727
function startOomTest(string $php, string $file, string $class): ?array

0 commit comments

Comments
 (0)