parallel-functions/examples/2-echo.php

10 lines
364 B
PHP

<?php
require __DIR__ . '/../vendor/autoload.php';
use function Amp\ParallelFunctions\parallelMap;
use function Amp\Promise\wait;
f
// All output in the parallel environment is redirected to STDERR of the parent process automatically.
// You might notice that the output order varies here when running it multiple times.
wait(parallelMap([1, 2, 3], 'var_dump'));