interface_exists

Supported Versions: PHP 5 >= 5.0.2, PHP 7, PHP 8
Checks if the interface has been defined
<?php interface_exists(string $interface, bool $autoload = true): bool
<?php     public function testAwaitThrowsUnexpectedValueExceptionWhenPromiseIsRejectedWithFalse(callable $await)

    {

        if (!interface_exists('React\Promise\CancellablePromiseInterface')) {

            $this->markTestSkipped('Promises must be rejected with a \Throwable instance since Promise v3');

        }
<?php     public function testAwaitThrowsUnexpectedValueExceptionWhenPromiseIsRejectedWithNull(callable $await)

    {

        if (!interface_exists('React\Promise\CancellablePromiseInterface')) {

            $this->markTestSkipped('Promises must be rejected with a \Throwable instance since Promise v3');

        }
<?php     public function testAwaitShouldNotCreateAnyGarbageReferencesForPromiseRejectedWithNullValue(callable $await)

    {

        if (!interface_exists('React\Promise\CancellablePromiseInterface')) {

            $this->markTestSkipped('Promises must be rejected with a \Throwable instance since Promise v3');

        }