19declare(strict_types=1);
23use InvalidArgumentException;
34 if (!preg_match(
'#^\s*(==|!=|[<>]=?)?\s*([0-9\.]+)\s*([kmg]i?)?\s*$#i', $test, $matches)) {
35 throw new InvalidArgumentException(sprintf(
'Don\'t understand "%s" as a number test.', $test));
40 throw new InvalidArgumentException(sprintf(
'Invalid number "%s".',
$target));
43 if (isset($matches[3])) {
44 switch (strtolower($matches[3])) {
setOperator(string $operator)
setTarget(string $target)
__construct(string $test)