3v4l.org

run code in 300+ PHP versions simultaneously
<?php if ($argc > 1) { var_dump($argv); } else { $descriptorspec = array( 0 => array("pipe", "r"), // stdin is a pipe that the child will read from 1 => array("pipe", "w"), // stdout is a pipe that the child will write to ); $proc = proc_open("php " . escapeshellarg($argv[0]) . " args lel", $descriptorspec, $pipes); fclose($pipes[0]); // default-inherited-stdin creeps me out while (proc_get_status($proc)['running']) { usleep(100 * 1000); } var_dump('stdout: ', stream_get_contents($pipes[1])); fclose($pipes[1]); proc_close($proc); }

preferences:
64.22 ms | 402 KiB | 5 Q