protected function isReadOnly($funcName, array $expression)
    {
        if ($this->isBuiltInFunction($funcName)) {
            return false;
        }

        /*
         * These functions are supposed to be read-only but they change parameters ref-count
         */
        switch ($funcName) {
            case 'min':
            case 'max':
            case 'array_fill':
            case 'array_pad':
            case 'call_user_func':
            case 'call_user_func_array':
                return false;
        }

        $reflector = $this->getReflector($funcName);
        if (!$reflector instanceof \ReflectionFunction) {
            return false;
        }

        $messageFormat = "The number of parameters passed is lesser than the number of required parameters by '%s'";

        if (isset($expression['parameters'])) {
            /**
             * Check if the number of parameters.
             */
            $numberParameters = \count($expression['parameters']);
            if ('unpack' == $funcName &&
                (0 == version_compare(PHP_VERSION, '7.1.0') ||
                    0 == version_compare(PHP_VERSION, '7.1.1'))
            ) {
                if ($numberParameters < 2) {
                    throw new CompilerException(sprintf($messageFormat, $funcName), $expression);
                }
            } else {
                if ($numberParameters < $reflector->getNumberOfRequiredParameters()) {
                    throw new CompilerException(sprintf($messageFormat, $funcName), $expression);
                }
            }
        } else {
            if ($reflector->getNumberOfRequiredParameters() > 0) {
                throw new CompilerException(sprintf($messageFormat, $funcName), $expression);
            }
        }

        if ($reflector->getNumberOfParameters() > 0) {
            foreach ($reflector->getParameters() as $parameter) {
                if ($parameter->isPassedByReference()) {
                    return false;
                }
            }
        }

        return true;
    }