extension_loaded

Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Find out whether an extension is loaded
<?php extension_loaded(string $extension): bool
<?php {

    public function createLoop($readStreamCompatible = false)

    {

        if ('Linux' === PHP_OS && !extension_loaded('posix')) {

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

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

        }



        if (!extension_loaded('event')) {

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

        }
<?php     public function createLoop()

    {

        if ('Linux' === PHP_OS && !extension_loaded('posix')) {

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

        }
<?php     protected function tearDownSignalHandlers()

    {

        parent::tearDown();

        if (strncmp($this->getName(false), 'testSignal', 10) === 0 && extension_loaded('pcntl')) {

            $this->resetSignalHandlers();

        }

    }
<?php {

    public function createLoop()

    {

        if (!extension_loaded('event')) {

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

        }