3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); /* * PHP 8.0+ throw exception in error handler while proc_open executable not in path warning exit code 127 (shell/system) */ error_reporting(~0); function error_handler($code, $message, $file, $line) { fprintf(STDOUT, "error: %s ** and throw **\n", var_export(array_slice(func_get_args(), 0, 4), true)); throw new ErrorException($message, 0, $code, $file, $line); // non-catchable non-fatal exception } set_error_handler('error_handler', ~0); $pipes = []; // command must be passed as array to trigger this, string won't work. $process = proc_open(['non-existent-command'], [], $pipes); // directly produce some output fprintf(STDOUT, "open: %d\n", $process); $status = proc_get_status($process); ksort($status); fprintf(STDOUT, "status: %s\n", json_encode($status)); // let proc finish usleep(100000); $status = proc_get_status($process); ksort($status); fprintf(STDOUT, "status: %s\n", json_encode($status)); $close = proc_close($process); fprintf(STDOUT, "close: %s\n", var_export($close, true));
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined function proc_open() in /in/gXjcI:17 Stack trace: #0 {main} thrown in /in/gXjcI on line 17
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
98.6 ms | 1121 KiB | 4 Q