Library/FunctionCall.php
public function functionExists($functionName, CompilationContext $context)
    {
        if (\function_exists($functionName)) {
            return true;
        }
        if ($this->isBuiltInFunction($functionName)) {
            return true;
        }

        $internalName = ['f__'.$functionName];
        if (isset($context->classDefinition)) {
            $lowerNamespace = strtolower($context->classDefinition->getNamespace());
            $prefix = 'f_'.str_replace('\\', '_', $lowerNamespace);

            $internalName[] = $prefix.'_'.$functionName;
        }

        foreach ($internalName as $name) {
            if (isset($context->compiler->functionDefinitions[$name])) {
                return true;
            }
        }

        return false;
    }
public function functionExists($functionName, CompilationContext $context)
    {
        if (\function_exists($functionName)) {
            return true;
        }
        if ($this->isBuiltInFunction($functionName)) {
            return true;
        }

        $internalName = ['f__'.$functionName];
        if (isset($context->classDefinition)) {
            $lowerNamespace = strtolower($context->classDefinition->getNamespace());
            $prefix = 'f_'.str_replace('\\', '_', $lowerNamespace);

            $internalName[] = $prefix.'_'.$functionName;
        }

        foreach ($internalName as $name) {
            if (isset($context->compiler->functionDefinitions[$name])) {
                return true;
            }
        }

        return false;
    }
public function functionExists ( $ functionName , CompilationContext $ context ) { if ( \ function_exists ( $ functionName ) ) { return true ; } if ( $ this -> isBuiltInFunction ( $ functionName ) ) { return true ; } $ internalName = [ 'f__' . $ functionName ] ; if ( isset ( $ context -> classDefinition ) ) { $ lowerNamespace = strtolower ( $ context -> classDefinition -> getNamespace ( ) ) ; $ prefix = 'f_' . str_replace ( '\\' , '_' , $ lowerNamespace ) ; $ internalName [ ] = $ prefix . '_' . $ functionName ; } foreach ( $ internalName as $ name ) { if ( isset ( $ context -> compiler -> functionDefinitions [ $ name ] ) ) { return true ; } } return false ; }
Checks if a function exists or is a built-in Zephir function.

@param string             $functionName
@param CompilationContext $context

@return bool
Checks if a function exists or is a built - in Zephir function .