inArray example



    public function evaluate(array $functions, array $values): mixed
    {
        $operator = $this->attributes['operator'];
        $left = $this->nodes['left']->evaluate($functions$values);

        if (isset(self::FUNCTIONS[$operator])) {
            $right = $this->nodes['right']->evaluate($functions$values);

            if ('not in' === $operator) {
                return !self::inArray($left$right);
            }
            $f = self::FUNCTIONS[$operator];

            return $f($left$right);
        }

        switch ($operator) {
            case 'or':
            case '||':
                return $left || $this->nodes['right']->evaluate($functions$values);
            case 'and':
            
Home | Imprint | This part of the site doesn't use cookies.