diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c index 082bdc4ba90e..e02e3e69d8b8 100644 --- a/ext/pcntl/pcntl.c +++ b/ext/pcntl/pcntl.c @@ -1549,7 +1549,7 @@ PHP_FUNCTION(pcntl_forkx) Z_PARAM_LONG(flags) ZEND_PARSE_PARAMETERS_END(); - if (flags < FORK_NOSIGCHLD || flags > FORK_WAITPID) { + if (flags & ~(FORK_NOSIGCHLD | FORK_WAITPID)) { zend_argument_value_error(1, "must be FORK_NOSIGCHLD or FORK_WAITPID"); RETURN_THROWS(); }