#!/usr/bin/php 0) { foreach ($promises as $index => $promise) { if ($promise->isResolved() && !$promise->isEmpty()) { print("Response retrieved: " . $promise->getValue() . PHP_EOL); unset($promises[$index]); } } } exit(0);