function_exists

Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Return true if the given function has been defined
function_exists(string $function): bool
    public function __construct()

    {

        if (!
\function_exists('event_base_new')) {

            throw new 
BadMethodCallException('Cannot create ExtLibeventLoop, ext-libevent extension missing');

        }
    public function __construct()

    {

        if (!
\function_exists('uv_loop_new')) {

            throw new 
\BadMethodCallException('Cannot create LibUvLoop, ext-uv extension missing');

        }
    private static function construct()

    {


        if (
\function_exists('uv_loop_new')) {


            return new 
ExtUvLoop();

        }
            return new ExtEventLoop();

        }



        if (
\function_exists('event_base_new') && \PHP_MAJOR_VERSION === 5) {


            return new 
ExtLibeventLoop();

        }
    {

        
$this->futureTickQueue = new FutureTickQueue();

        
$this->timers = new Timers();

        
$this->pcntl \function_exists('pcntl_signal') && \function_exists('pcntl_signal_dispatch');

        
$this->pcntlPoll $this->pcntl && !\function_exists('pcntl_async_signals');

        
$this->signals = new SignalsHandler();
        $this->futureTickQueue = new FutureTickQueue();

        
$this->timers = new Timers();

        
$this->pcntl \function_exists('pcntl_signal') && \function_exists('pcntl_signal_dispatch');

        
$this->pcntlPoll $this->pcntl && !\function_exists('pcntl_async_signals');

        
$this->signals = new SignalsHandler();
    public function __construct()

    {


        
$this->useHighResolution \function_exists('hrtime');

    }



    public function 
updateTime()
        $sockets stream_socket_pair($domainSTREAM_SOCK_STREAMSTREAM_IPPROTO_IP);



        foreach (
$sockets as $socket) {

            if (
function_exists('stream_set_read_buffer')) {

                
stream_set_read_buffer($socket0);

            }

        }
    public function testSignal()

    {

        if (!
function_exists('posix_kill') || !function_exists('posix_getpid')) {

            
$this->markTestSkipped('Signal test skipped because functions "posix_kill" and "posix_getpid" are missing.');

        }
            $this->markTestSkipped('libevent tests skipped on linux due to linux epoll issues.');

        }



        if (!
function_exists('event_base_new')) {

            
$this->markTestSkipped('libevent tests skipped because ext-libevent is not installed.');

        }
{

    public function 
createLoop()

    {

        if (!
function_exists('uv_loop_new')) {

            
$this->markTestSkipped('uv tests skipped because ext-uv is not installed.');

        }
{

    public function 
createLoop()

    {

        if (!
function_exists('event_base_new')) {

            
$this->markTestSkipped('libevent tests skipped because ext-libevent is not installed.');

        }
{

    public function 
createLoop()

    {

        if (!
function_exists('uv_loop_new')) {

            
$this->markTestSkipped('uv tests skipped because ext-uv is not installed.');

        }