proc_open.php 441 B

1234567891011121314151617181920
  1. <?php
  2. Swoole\Runtime::setHookFlags(SWOOLE_HOOK_ALL);
  3. Swoole\Coroutine\run(function () {
  4. $descriptorspec = array(
  5. 0 => array("pipe", "r"),
  6. 1 => array("pipe", "w"),
  7. 2 => array("pipe", "w"),
  8. );
  9. $process = proc_open('unknown', $descriptorspec, $pipes);
  10. var_dump($pipes);
  11. var_dump(fread($pipes[2], 8192));
  12. $return_value = proc_close($process);
  13. echo "command returned $return_value\n";
  14. });