> For the complete documentation index, see [llms.txt](https://venndev.gitbook.io/vapm/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://venndev.gitbook.io/vapm/promise/allsettled.md).

# allSettled()

```php
/**
 * @throws Throwable
 * @param array<int, Async|Promise|callable> $promises
 * @phpstan-param array<int, Async|Promise|callable> $promises
 */
public static function allSettled(array $promises): Promise;
```

The **`Promise::allSettled()`** static method takes an iterable of promises as input and returns a single Promise. This returned promise fulfills when all of the input's promises settle (including when an empty iterable is passed), with an array of objects that describe the outcome of each promise.

Example:

```php
function testPromise1() : Promise { 
    return new Promise(function ($resolve, $reject) {
        $resolve("A");
    });
}

function testPromise2() : Promise {
    return new Promise(function ($resolve, $reject) {
        $reject("B");
    });
}

Promise::allSettled([
	testPromise1(),
	testPromise2()
])->then(fn($result) => var_dump($promise));
```

Output:

```
A
B
```
