Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Get the type of a variable
<?php gettype(mixed $value): string
<?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;

        }