Zephir\Cache\FunctionCache::get PHP Метод

get() публичный Метод

Retrieves/Creates a function cache for a function call
public get ( string $functionName, Zephir\CompilationContext $compilationContext, Call $call, boolean $exists ) : string
$functionName string
$compilationContext Zephir\CompilationContext
$call Zephir\Call
$exists boolean
Результат string
    public function get($functionName, CompilationContext $compilationContext, Call $call, $exists)
    {
        if (isset($this->cache[$functionName])) {
            return $this->cache[$functionName] . ', ' . SlotsCache::getExistingFunctionSlot($functionName);
        }
        if (!$exists) {
            return 'NULL, 0';
        }
        $cacheSlot = SlotsCache::getFunctionSlot($functionName);
        $number = 0;
        if (!$compilationContext->insideCycle) {
            $gatherer = $this->gatherer;
            if ($gatherer) {
                $number = $gatherer->getNumberOfFunctionCalls($functionName);
                if ($number <= 1) {
                    return 'NULL, ' . $cacheSlot;
                }
            }
        }
        if ($compilationContext->insideCycle || $number > 1) {
            $functionCacheVariable = $compilationContext->symbolTable->getTempVariableForWrite('zephir_fcall_cache_entry', $compilationContext);
            $functionCacheVariable->setMustInitNull(true);
            $functionCacheVariable->setReusable(false);
            $functionCache = '&' . $functionCacheVariable->getName();
        } else {
            $functionCache = 'NULL';
        }
        $this->cache[$functionName] = $functionCache;
        return $functionCache . ', ' . $cacheSlot;
    }
FunctionCache