Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Finds whether a variable is an object
<?php is_object(mixed $value): bool
<?php         function (mixed $throwable) use (&$rejected, &$rejectedThrowable, &$fiber): void {

            if (!$throwable instanceof \Throwable) {

                $throwable = new \UnexpectedValueException(

                    'Promise rejected with unexpected value of type ' . (is_object($throwable) ? get_class($throwable) : gettype($throwable))

                );

            }
<?php         if (!$promise instanceof PromiseInterface) {

            $next = null;

            $deferred->reject(new \UnexpectedValueException(

                'Expected coroutine to yield ' . PromiseInterface::class . ', but got ' . (is_object($promise) ? get_class($promise) : gettype($promise))

            ));

            return;

        }