diff --git a/src/API.php b/src/API.php index 88724bfba..54119a95c 100644 --- a/src/API.php +++ b/src/API.php @@ -41,6 +41,7 @@ use Webmozart\Assert\Assert; use function Amp\async; use function Amp\Future\await; +use function Amp\Future\awaitFirst; /** * Main API wrapper for MadelineProto. @@ -409,7 +410,7 @@ final class API extends AbstractAPI $instance->startAndLoopLogic($eventHandler[$k], $started[$k]); }); } - await($promises); + awaitFirst($promises); } finally { if (EventLoop::getErrorHandler() === $cb) { EventLoop::setErrorHandler($prev); diff --git a/src/polyfill.php b/src/polyfill.php index 62194f9ca..31ab6112c 100644 --- a/src/polyfill.php +++ b/src/polyfill.php @@ -9,7 +9,7 @@ if (defined('MADELINE_POLYFILLED')) { define('MADELINE_POLYFILLED', true); if (PHP_VERSION_ID === 80202 || PHP_VERSION_ID === 80115) { - echo('PHP 8.2.2 and PHP 8.1.15 have a critical garbage collector bug, please switch to PHP 8.1.14, PHP 8.2.1 or PHP 8.2.3 once it gets released: https://github.com/php/php-src/issues/10496'); + echo('PHP 8.2.2 and PHP 8.1.15 have a critical garbage collector bug, please switch to PHP 8.1.14, PHP 8.2.1 or PHP 8.2.3 once it gets released: https://github.com/php/php-src/issues/10496'.PHP_EOL); die(1); }