3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php error_reporting(-1); ini_set('display_errors', 1); $command = '/bin/bash -c "sleep 30"'; $dir = "/"; $pipes = array(); $error = $output = ""; $process = proc_open( $command, array( 0 => array('pipe', 'r'), 1 => array('pipe', 'w'), 2 => array('pipe', 'w') ), $pipes, $dir ); if (is_resource($process)) { $status = proc_get_status($process); printf("pid: %s running: %d exitcode: %d\n", $status['pid'], $status['running'], $status['exitcode']); print "killing proc_open'ed process\n"; posix_kill($status['pid'], 9); sleep(1); $status = proc_get_status($process); printf("pid: %s running: %d exitcode: %d\n", $status['pid'], $status['running'], $status['exitcode']); } else { printf("proc_open failed for command %s\n", $command); }
Output for 7.1.20 - 7.3.1
Warning: proc_open() has been disabled for security reasons in /in/B7nNL on line 20 proc_open failed for command /bin/bash -c "sleep 30"
Output for 7.1.10
pid: 17453 running: 1 exitcode: -1 killing proc_open'ed process pid: 17453 running: 0 exitcode: 127
Output for 7.1.7
pid: 17453 running: 0 exitcode: 127 killing proc_open'ed process pid: 17453 running: 0 exitcode: -1
Output for 7.1.6
pid: 10143 running: 1 exitcode: -1 killing proc_open'ed process pid: 10143 running: 0 exitcode: 127
Output for 7.1.5
pid: 22681 running: 0 exitcode: 127 killing proc_open'ed process pid: 22681 running: 0 exitcode: -1
Output for 7.1.0
pid: 909 running: 1 exitcode: -1 killing proc_open'ed process pid: 909 running: 0 exitcode: 127
Output for 7.0.20
pid: 8878 running: 1 exitcode: -1 killing proc_open'ed process pid: 8878 running: 0 exitcode: 127
Output for 7.0.14
pid: 31786 running: 1 exitcode: -1 killing proc_open'ed process pid: 31786 running: 0 exitcode: 127
Output for 7.0.6
pid: 1258 running: 1 exitcode: -1 killing proc_open'ed process pid: 1258 running: 0 exitcode: -1
Output for 7.0.5
pid: 7772 running: 1 exitcode: -1 killing proc_open'ed process pid: 7772 running: 0 exitcode: -1
Output for 7.0.4
pid: 12529 running: 1 exitcode: -1 killing proc_open'ed process pid: 12529 running: 0 exitcode: 127
Output for 7.0.3
pid: 20147 running: 1 exitcode: -1 killing proc_open'ed process pid: 20147 running: 0 exitcode: 127
Output for 7.0.2
pid: 15300 running: 1 exitcode: -1 killing proc_open'ed process pid: 15300 running: 0 exitcode: 127
Output for 7.0.1
pid: 1845 running: 1 exitcode: -1 killing proc_open'ed process pid: 1845 running: 0 exitcode: 127
Output for 7.0.0
pid: 27724 running: 1 exitcode: -1 killing proc_open'ed process pid: 27724 running: 0 exitcode: 127
Output for 5.6.28
pid: 24185 running: 1 exitcode: -1 killing proc_open'ed process pid: 24185 running: 0 exitcode: -1
Output for 5.6.21
pid: 2628 running: 1 exitcode: -1 killing proc_open'ed process pid: 2628 running: 0 exitcode: -1
Output for 5.6.20
pid: 27437 running: 1 exitcode: -1 killing proc_open'ed process pid: 27437 running: 0 exitcode: -1
Output for 5.6.19
pid: 10794 running: 1 exitcode: -1 killing proc_open'ed process pid: 10794 running: 0 exitcode: -1
Output for 5.6.18
pid: 791 running: 1 exitcode: -1 killing proc_open'ed process pid: 791 running: 0 exitcode: -1
Output for 5.6.17
pid: 16673 running: 1 exitcode: -1 killing proc_open'ed process pid: 16673 running: 0 exitcode: -1
Output for 5.6.16
pid: 21280 running: 1 exitcode: -1 killing proc_open'ed process pid: 21280 running: 0 exitcode: -1
Output for 5.6.15
pid: 17485 running: 1 exitcode: -1 killing proc_open'ed process pid: 17485 running: 0 exitcode: -1
Output for 5.6.14
pid: 21580 running: 1 exitcode: -1 killing proc_open'ed process pid: 21580 running: 0 exitcode: -1
Output for 5.6.13
pid: 8523 running: 1 exitcode: -1 killing proc_open'ed process pid: 8523 running: 0 exitcode: -1
Output for 5.6.12
pid: 3823 running: 1 exitcode: -1 killing proc_open'ed process pid: 3823 running: 0 exitcode: -1
Output for 5.6.11
pid: 25701 running: 1 exitcode: -1 killing proc_open'ed process pid: 25701 running: 0 exitcode: -1
Output for 5.6.10
pid: 12467 running: 1 exitcode: -1 killing proc_open'ed process pid: 12467 running: 0 exitcode: -1
Output for 5.6.9
pid: 14839 running: 1 exitcode: -1 killing proc_open'ed process pid: 14839 running: 0 exitcode: -1
Output for 5.6.8
pid: 19155 running: 1 exitcode: -1 killing proc_open'ed process pid: 19155 running: 0 exitcode: -1
Output for 5.6.7
pid: 26721 running: 1 exitcode: -1 killing proc_open'ed process pid: 26721 running: 0 exitcode: -1
Output for 5.5.35
pid: 14379 running: 1 exitcode: -1 killing proc_open'ed process pid: 14379 running: 0 exitcode: -1
Output for 5.5.34
pid: 27974 running: 1 exitcode: -1 killing proc_open'ed process pid: 27974 running: 0 exitcode: -1
Output for 5.5.33
pid: 9632 running: 1 exitcode: -1 killing proc_open'ed process pid: 9632 running: 0 exitcode: -1
Output for 5.5.32
pid: 23162 running: 1 exitcode: -1 killing proc_open'ed process pid: 23162 running: 0 exitcode: -1
Output for 5.5.31
pid: 12753 running: 1 exitcode: -1 killing proc_open'ed process pid: 12753 running: 0 exitcode: -1
Output for 5.5.30
pid: 25222 running: 1 exitcode: -1 killing proc_open'ed process pid: 25222 running: 0 exitcode: -1
Output for 5.5.29
pid: 31590 running: 1 exitcode: -1 killing proc_open'ed process pid: 31590 running: 0 exitcode: -1
Output for 5.5.28
pid: 21720 running: 1 exitcode: -1 killing proc_open'ed process pid: 21720 running: 0 exitcode: -1
Output for 5.5.27
pid: 7884 running: 1 exitcode: -1 killing proc_open'ed process pid: 7884 running: 0 exitcode: -1
Output for 5.5.26
pid: 30469 running: 1 exitcode: -1 killing proc_open'ed process pid: 30469 running: 0 exitcode: -1
Output for 5.5.25
pid: 540 running: 1 exitcode: -1 killing proc_open'ed process pid: 540 running: 0 exitcode: -1
Output for 5.5.24
pid: 18815 running: 1 exitcode: -1 killing proc_open'ed process pid: 18815 running: 0 exitcode: -1
Output for 5.4.45
pid: 11521 running: 1 exitcode: -1 killing proc_open'ed process pid: 11521 running: 0 exitcode: -1
Output for 5.4.44
pid: 15308 running: 1 exitcode: -1 killing proc_open'ed process pid: 15308 running: 0 exitcode: -1
Output for 5.4.43
pid: 20437 running: 1 exitcode: -1 killing proc_open'ed process pid: 20437 running: 0 exitcode: -1
Output for 5.4.42
pid: 17151 running: 1 exitcode: -1 killing proc_open'ed process pid: 17151 running: 0 exitcode: -1
Output for 5.4.41
pid: 4994 running: 1 exitcode: -1 killing proc_open'ed process pid: 4994 running: 0 exitcode: -1
Output for 5.4.40
pid: 4746 running: 1 exitcode: -1 killing proc_open'ed process pid: 4746 running: 0 exitcode: -1
Output for 5.4.39
pid: 4702 running: 1 exitcode: -1 killing proc_open'ed process pid: 4702 running: 0 exitcode: -1
Output for 5.4.38
pid: 4643 running: 1 exitcode: -1 killing proc_open'ed process pid: 4643 running: 0 exitcode: -1
Output for 5.4.37
Warning: ini_set() has been disabled for security reasons in /in/B7nNL on line 4 pid: 16179 running: 1 exitcode: -1 killing proc_open'ed process pid: 16179 running: 0 exitcode: -1
Output for 5.4.36
Warning: ini_set() has been disabled for security reasons in /in/B7nNL on line 4 pid: 16172 running: 1 exitcode: -1 killing proc_open'ed process pid: 16172 running: 0 exitcode: -1
Output for 5.4.35
Warning: ini_set() has been disabled for security reasons in /in/B7nNL on line 4 pid: 20639 running: 1 exitcode: -1 killing proc_open'ed process pid: 20639 running: 0 exitcode: -1
Output for 5.4.34
Warning: ini_set() has been disabled for security reasons in /in/B7nNL on line 4 pid: 20630 running: 1 exitcode: -1 killing proc_open'ed process pid: 20630 running: 0 exitcode: -1
Output for 5.4.32
Warning: ini_set() has been disabled for security reasons in /in/B7nNL on line 4 pid: 10990 running: 1 exitcode: -1 killing proc_open'ed process pid: 10990 running: 0 exitcode: -1
Output for 5.4.31
Warning: ini_set() has been disabled for security reasons in /in/B7nNL on line 4 pid: 10888 running: 1 exitcode: -1 killing proc_open'ed process pid: 10888 running: 0 exitcode: -1
Output for 5.4.30
Warning: ini_set() has been disabled for security reasons in /in/B7nNL on line 4 pid: 10794 running: 1 exitcode: -1 killing proc_open'ed process pid: 10794 running: 0 exitcode: -1
Output for 5.4.29
Warning: ini_set() has been disabled for security reasons in /in/B7nNL on line 4 pid: 10785 running: 1 exitcode: -1 killing proc_open'ed process pid: 10785 running: 0 exitcode: -1
Output for 5.4.28
Warning: ini_set() has been disabled for security reasons in /in/B7nNL on line 4 pid: 10766 running: 1 exitcode: -1 killing proc_open'ed process pid: 10766 running: 0 exitcode: -1
Output for 5.4.27
Warning: ini_set() has been disabled for security reasons in /in/B7nNL on line 4 pid: 10915 running: 1 exitcode: -1 killing proc_open'ed process pid: 10915 running: 0 exitcode: -1
Output for 5.4.26
pid: 28221 running: 1 exitcode: -1 killing proc_open'ed process pid: 28221 running: 0 exitcode: -1
Output for 5.4.25
pid: 28219 running: 1 exitcode: -1 killing proc_open'ed process pid: 28219 running: 0 exitcode: -1
Output for 5.4.24
pid: 28217 running: 1 exitcode: -1 killing proc_open'ed process pid: 28217 running: 0 exitcode: -1
Output for 5.4.23
pid: 28215 running: 1 exitcode: -1 killing proc_open'ed process pid: 28215 running: 0 exitcode: -1
Output for 5.4.22
pid: 28211 running: 1 exitcode: -1 killing proc_open'ed process pid: 28211 running: 0 exitcode: -1
Output for 5.4.21
pid: 28209 running: 1 exitcode: -1 killing proc_open'ed process pid: 28209 running: 0 exitcode: -1
Output for 5.4.20
pid: 28207 running: 1 exitcode: -1 killing proc_open'ed process pid: 28207 running: 0 exitcode: 127
Output for 5.4.19
pid: 28205 running: 1 exitcode: -1 killing proc_open'ed process pid: 28205 running: 0 exitcode: -1
Output for 5.4.18
pid: 28203 running: 1 exitcode: -1 killing proc_open'ed process pid: 28203 running: 0 exitcode: -1
Output for 5.4.17
pid: 28170 running: 1 exitcode: -1 killing proc_open'ed process pid: 28170 running: 0 exitcode: -1
Output for 5.4.16
pid: 28132 running: 1 exitcode: -1 killing proc_open'ed process pid: 28132 running: 0 exitcode: -1
Output for 5.4.15
pid: 28127 running: 1 exitcode: -1 killing proc_open'ed process pid: 28127 running: 0 exitcode: -1
Output for 5.4.14
pid: 28113 running: 1 exitcode: -1 killing proc_open'ed process pid: 28113 running: 0 exitcode: -1
Output for 5.4.13
pid: 28073 running: 1 exitcode: -1 killing proc_open'ed process pid: 28073 running: 0 exitcode: -1
Output for 5.4.12
pid: 28044 running: 1 exitcode: -1 killing proc_open'ed process pid: 28044 running: 0 exitcode: -1
Output for 5.4.11
pid: 27994 running: 1 exitcode: -1 killing proc_open'ed process pid: 27994 running: 0 exitcode: -1
Output for 5.4.10
pid: 27979 running: 1 exitcode: -1 killing proc_open'ed process pid: 27979 running: 0 exitcode: -1
Output for 5.4.9
pid: 27977 running: 1 exitcode: -1 killing proc_open'ed process pid: 27977 running: 0 exitcode: -1
Output for 5.4.8
pid: 27971 running: 1 exitcode: -1 killing proc_open'ed process pid: 27971 running: 0 exitcode: -1
Output for 5.4.7
pid: 27967 running: 1 exitcode: -1 killing proc_open'ed process pid: 27967 running: 0 exitcode: -1
Output for 5.4.6
pid: 27965 running: 1 exitcode: -1 killing proc_open'ed process pid: 27965 running: 0 exitcode: -1
Output for 5.4.5
pid: 27959 running: 1 exitcode: -1 killing proc_open'ed process pid: 27959 running: 0 exitcode: -1
Output for 5.4.4
pid: 27955 running: 1 exitcode: -1 killing proc_open'ed process pid: 27955 running: 0 exitcode: -1
Output for 5.4.3
pid: 27953 running: 1 exitcode: -1 killing proc_open'ed process pid: 27953 running: 0 exitcode: -1
Output for 5.4.2
pid: 27947 running: 1 exitcode: -1 killing proc_open'ed process pid: 27947 running: 0 exitcode: -1
Output for 5.4.1
pid: 27943 running: 1 exitcode: -1 killing proc_open'ed process pid: 27943 running: 0 exitcode: -1
Output for 5.4.0
pid: 27941 running: 1 exitcode: -1 killing proc_open'ed process pid: 27941 running: 0 exitcode: 127
Output for 5.3.29
Warning: ini_set() has been disabled for security reasons in /in/B7nNL on line 4 pid: 10812 running: 1 exitcode: -1 killing proc_open'ed process pid: 10812 running: 0 exitcode: -1
Output for 5.3.28
pid: 28213 running: 1 exitcode: -1 killing proc_open'ed process pid: 28213 running: 0 exitcode: -1
Output for 5.3.27
pid: 28192 running: 1 exitcode: -1 killing proc_open'ed process pid: 28192 running: 0 exitcode: -1
Output for 5.3.26
pid: 28150 running: 1 exitcode: -1 killing proc_open'ed process pid: 28150 running: 0 exitcode: -1
Output for 5.3.25
pid: 28129 running: 1 exitcode: -1 killing proc_open'ed process pid: 28129 running: 0 exitcode: -1
Output for 5.3.24
pid: 28092 running: 1 exitcode: -1 killing proc_open'ed process pid: 28092 running: 0 exitcode: -1
Output for 5.3.23
pid: 28058 running: 1 exitcode: -1 killing proc_open'ed process pid: 28058 running: 0 exitcode: -1
Output for 5.3.22
pid: 28027 running: 1 exitcode: -1 killing proc_open'ed process pid: 28027 running: 0 exitcode: -1
Output for 5.3.21
pid: 28010 running: 1 exitcode: -1 killing proc_open'ed process pid: 28010 running: 0 exitcode: -1
Output for 5.3.20
pid: 27982 running: 1 exitcode: -1 killing proc_open'ed process pid: 27982 running: 0 exitcode: -1
Output for 5.3.19
pid: 27975 running: 1 exitcode: -1 killing proc_open'ed process pid: 27975 running: 0 exitcode: 127
Output for 5.3.18
pid: 27973 running: 1 exitcode: -1 killing proc_open'ed process pid: 27973 running: 0 exitcode: -1
Output for 5.3.17
pid: 27969 running: 1 exitcode: -1 killing proc_open'ed process pid: 27969 running: 0 exitcode: -1
Output for 5.3.16
pid: 27963 running: 1 exitcode: -1 killing proc_open'ed process pid: 27963 running: 0 exitcode: -1
Output for 5.3.15
pid: 27961 running: 1 exitcode: -1 killing proc_open'ed process pid: 27961 running: 0 exitcode: -1
Output for 5.3.14
pid: 27957 running: 1 exitcode: -1 killing proc_open'ed process pid: 27957 running: 0 exitcode: -1
Output for 5.3.13
pid: 27951 running: 1 exitcode: -1 killing proc_open'ed process pid: 27951 running: 0 exitcode: -1
Output for 5.3.12
pid: 27949 running: 1 exitcode: -1 killing proc_open'ed process pid: 27949 running: 0 exitcode: -1
Output for 5.3.11
pid: 27945 running: 1 exitcode: -1 killing proc_open'ed process pid: 27945 running: 0 exitcode: 127
Output for 5.3.10
pid: 27939 running: 1 exitcode: -1 killing proc_open'ed process pid: 27939 running: 0 exitcode: -1
Output for 5.3.9
pid: 27937 running: 1 exitcode: -1 killing proc_open'ed process pid: 27937 running: 0 exitcode: -1
Output for 5.3.8
pid: 27935 running: 1 exitcode: -1 killing proc_open'ed process pid: 27935 running: 0 exitcode: -1
Output for 5.3.7
pid: 27933 running: 1 exitcode: -1 killing proc_open'ed process pid: 27933 running: 0 exitcode: -1
Output for 5.3.6
pid: 27931 running: 1 exitcode: -1 killing proc_open'ed process pid: 27931 running: 0 exitcode: -1
Output for 5.3.5
pid: 27929 running: 1 exitcode: -1 killing proc_open'ed process pid: 27929 running: 0 exitcode: -1
Output for 5.3.4
pid: 27923 running: 1 exitcode: -1 killing proc_open'ed process pid: 27923 running: 0 exitcode: -1
Output for 5.3.3
pid: 27919 running: 1 exitcode: -1 killing proc_open'ed process pid: 27919 running: 0 exitcode: 127
Output for 5.3.2
pid: 27915 running: 1 exitcode: -1 killing proc_open'ed process pid: 27915 running: 0 exitcode: -1
Output for 5.3.1
pid: 27909 running: 1 exitcode: -1 killing proc_open'ed process pid: 27909 running: 0 exitcode: 127
Output for 5.3.0
pid: 27905 running: 1 exitcode: -1 killing proc_open'ed process pid: 27905 running: 0 exitcode: -1
Output for 5.2.17
pid: 27927 running: 1 exitcode: -1 killing proc_open'ed process pid: 27927 running: 0 exitcode: 127
Output for 5.2.16
pid: 27925 running: 1 exitcode: -1 killing proc_open'ed process pid: 27925 running: 0 exitcode: -1
Output for 5.2.15
pid: 27921 running: 1 exitcode: -1 killing proc_open'ed process pid: 27921 running: 0 exitcode: -1
Output for 5.2.14
pid: 27917 running: 1 exitcode: -1 killing proc_open'ed process pid: 27917 running: 0 exitcode: -1
Output for 5.2.13
pid: 27913 running: 1 exitcode: -1 killing proc_open'ed process pid: 27913 running: 0 exitcode: 127
Output for 5.2.12
pid: 27911 running: 1 exitcode: -1 killing proc_open'ed process pid: 27911 running: 0 exitcode: -1
Output for 5.2.11
pid: 27907 running: 1 exitcode: -1 killing proc_open'ed process pid: 27907 running: 0 exitcode: -1
Output for 5.2.10
pid: 27903 running: 1 exitcode: -1 killing proc_open'ed process pid: 27903 running: 0 exitcode: -1
Output for 5.2.9
pid: 27901 running: 1 exitcode: -1 killing proc_open'ed process pid: 27901 running: 0 exitcode: -1
Output for 5.2.8
pid: 27899 running: 1 exitcode: -1 killing proc_open'ed process pid: 27899 running: 0 exitcode: -1
Output for 5.2.7
pid: 27897 running: 1 exitcode: -1 killing proc_open'ed process pid: 27897 running: 0 exitcode: -1
Output for 5.2.6
pid: 27894 running: 1 exitcode: -1 killing proc_open'ed process pid: 27894 running: 0 exitcode: -1
Output for 5.2.5
pid: 27891 running: 1 exitcode: -1 killing proc_open'ed process pid: 27891 running: 0 exitcode: -1
Output for 5.2.4
pid: 27889 running: 1 exitcode: -1 killing proc_open'ed process pid: 27889 running: 0 exitcode: -1
Output for 5.2.3
pid: 27887 running: 1 exitcode: -1 killing proc_open'ed process pid: 27887 running: 0 exitcode: -1
Output for 5.2.2
pid: 27885 running: 1 exitcode: -1 killing proc_open'ed process pid: 27885 running: 0 exitcode: 127
Output for 5.2.1
pid: 27880 running: 1 exitcode: -1 killing proc_open'ed process pid: 27880 running: 0 exitcode: -1
Output for 5.2.0
pid: 27878 running: 1 exitcode: -1 killing proc_open'ed process pid: 27878 running: 0 exitcode: -1
Output for 5.1.6
pid: 27876 running: 1 exitcode: -1 killing proc_open'ed process pid: 27876 running: 0 exitcode: -1
Output for 5.1.5
pid: 27873 running: 1 exitcode: -1 killing proc_open'ed process pid: 27873 running: 0 exitcode: -1
Output for 5.1.4
pid: 27870 running: 1 exitcode: -1 killing proc_open'ed process pid: 27870 running: 0 exitcode: -1
Output for 5.1.3
pid: 27868 running: 1 exitcode: -1 killing proc_open'ed process pid: 27868 running: 0 exitcode: -1
Output for 5.1.2
pid: 27866 running: 1 exitcode: -1 killing proc_open'ed process pid: 27866 running: 0 exitcode: -1
Output for 5.1.1
pid: 27863 running: 1 exitcode: -1 killing proc_open'ed process pid: 27863 running: 0 exitcode: 127
Output for 5.1.0
pid: 27861 running: 1 exitcode: -1 killing proc_open'ed process pid: 27861 running: 0 exitcode: 127
Output for 5.0.5
pid: 27858 running: 1 exitcode: -1 killing proc_open'ed process pid: 27858 running: 0 exitcode: 127
Output for 5.0.4
pid: 27855 running: 0 exitcode: -1 killing proc_open'ed process pid: 27855 running: 1 exitcode: -1
Output for 5.0.3
pid: 27852 running: 1 exitcode: -1 killing proc_open'ed process pid: 27852 running: 1 exitcode: -1
Output for 5.0.2
pid: 27849 running: 1 exitcode: -1 killing proc_open'ed process pid: 27849 running: 0 exitcode: 127
Output for 5.0.1
pid: 27846 running: 1 exitcode: -1 killing proc_open'ed process pid: 27846 running: 1 exitcode: -1
Output for 5.0.0
pid: 27844 running: 1 exitcode: -1 killing proc_open'ed process pid: 27844 running: 0 exitcode: 127
Output for 4.3.0 - 4.4.9
Warning: proc_open() expects exactly 3 parameters, 4 given in /in/B7nNL on line 21 proc_open failed for command /bin/bash -c "sleep 30"