lib/Loop/DriverFactory.php
public function create(): Driver
    {
        if ($driver = $this->createDriverFromEnv()) {
            return $driver;
        }

        if (UvDriver::isSupported()) {
            return new UvDriver;
        }

        if (EvDriver::isSupported()) {
            return new EvDriver;
        }

        if (EventDriver::isSupported()) {
            return new EventDriver;
        }

        return new NativeDriver;
    }
public function create(): Driver
    {
        if ($driver = $this->createDriverFromEnv()) {
            return $driver;
        }

        if (UvDriver::isSupported()) {
            return new UvDriver;
        }

        if (EvDriver::isSupported()) {
            return new EvDriver;
        }

        if (EventDriver::isSupported()) {
            return new EventDriver;
        }

        return new NativeDriver;
    }
public function create ( ) : Driver { if ( $ driver = $ this -> createDriverFromEnv ( ) ) { return $ driver ; } if ( UvDriver :: isSupported ( ) ) { return new UvDriver ; } if ( EvDriver :: isSupported ( ) ) { return new EvDriver ; } if ( EventDriver :: isSupported ( ) ) { return new EventDriver ; } return new NativeDriver ; }
Creates a new loop instance and chooses the best available driver.

@return Driver

@throws \Error If an invalid class has been specified via AMP_LOOP_DRIVER
Creates a new loop instance and chooses the best available driver .