parallel-functions/examples/3-return-value.php

9 lines
288 B
PHP
Raw Normal View History

2017-12-13 22:58:26 +01:00
<?php
require __DIR__ . '/../vendor/autoload.php';
use function Amp\ParallelClosure\parallel_map;
use function Amp\Promise\wait;
// We have seen that the order can vary in the previous example, values returned have a deterministic order.
var_dump(wait(parallel_map([1, 2, 3], 'abs')));