PHP code example of fiber-interop / process

1. Go to this page and download the library: Download fiber-interop/process library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

fiber-interop / process example snippets


use function fiber\{run, go, await_all};

[$a, $b] = run(fn() => await_all([
    go(fn() => fiber\process\run(['git', 'log', '-1', '--format=%H'])),
    go(fn() => fiber\process\run('gzip -c | wc -c', stdin: $bigString, timeout: 10)),
]));
echo $a->stdout, $b->stdout, $b->exitCode;