private function compute(string $expression): int
    {
        // catch anything which could be a security issue
        if (0 !== preg_match("/[^\d.+*%^|&~<>\/()-]/", $this->expression)) {
            throw new \InvalidArgumentException('Wrong value in error types config value:' . $this->expression);
        }

        return 0 + (int)eval('return ' . $expression . ';');
    }
private function compute(string $expression): int
    {
        // catch anything which could be a security issue
        if (0 !== preg_match("/[^\d.+*%^|&~<>\/()-]/", $this->expression)) {
            throw new \InvalidArgumentException('Wrong value in error types config value:' . $this->expression);
        }

        return 0 + (int)eval('return ' . $expression . ';');
    }
private function compute ( string $ expression ) : int { // catch anything which could be a security issue if ( 0 !== preg_match ( "/[^\d.+*%^|&~<>\/()-]/" , $ this -> expression ) ) { throw new \ InvalidArgumentException ( 'Wrong value in error types config value:' . $ this -> expression ) ; } return 0 + ( int ) eval ( 'return ' . $ expression . ';' ) ; }
Let PHP compute the prepared expression for us.

@param  string $expression prepared expression e.g. 32767&~8192&~8
@return int  computed expression e.g. 24567
@throws \InvalidArgumentException
Let PHP compute the prepared expression for us .