3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php error_reporting(-1); `ls -lah` $command = 'php -r "sleep(30);"'; $pipes = array(); $error = $output = ""; $process = proc_open( $command, array( 0 => array('pipe', 'r'), 1 => array('pipe', 'w'), 2 => array('pipe', 'w') ), $pipes ); usleep(1000); if (is_resource($process)) { $status = proc_get_status($process); printf("running: %d exitcode: %d\n", $status['running'], $status['exitcode']); print "killing proc_open'ed process\n"; posix_kill($status['pid'], 9); $status = proc_get_status($process); printf("running: %d exitcode: %d\n", $status['running'], $status['exitcode']); } else { printf("proc_open failed for command %s\n", $command); }
Output for 5.4.0 - 5.4.26
Parse error: syntax error, unexpected '$command' (T_VARIABLE) in /in/dpoM1 on line 7
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.28
Parse error: syntax error, unexpected T_VARIABLE in /in/dpoM1 on line 7
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_VARIABLE in /in/dpoM1 on line 7
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/dpoM1 on line 7
Process exited with code 255.