3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php error_reporting(-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("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("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.0
running: 956 exitcode: 1 killing proc_open'ed process running: 956 exitcode: 0
Output for 7.0.14
running: 31833 exitcode: 1 killing proc_open'ed process running: 31833 exitcode: 0
Output for 7.0.6
running: 9611 exitcode: 1 killing proc_open'ed process running: 9611 exitcode: 0
Output for 7.0.5
running: 16656 exitcode: 1 killing proc_open'ed process running: 16656 exitcode: 0
Output for 7.0.4
running: 23365 exitcode: 1 killing proc_open'ed process running: 23365 exitcode: 0
Output for 7.0.3
running: 30804 exitcode: 1 killing proc_open'ed process running: 30804 exitcode: 0
Output for 7.0.2
running: 25942 exitcode: 1 killing proc_open'ed process running: 25942 exitcode: 0
Output for 7.0.1
running: 12486 exitcode: 0 killing proc_open'ed process running: 12486 exitcode: 0
Output for 7.0.0
running: 5363 exitcode: 1 killing proc_open'ed process running: 5363 exitcode: 0
Output for hhvm-3.12.0
running: 3541 exitcode: 1 killing proc_open'ed process running: 3541 exitcode: 0
Output for hhvm-3.10.0
running: 20314 exitcode: 1 killing proc_open'ed process running: 20314 exitcode: 0
Output for 5.6.21
running: 11015 exitcode: 1 killing proc_open'ed process running: 11015 exitcode: 0
Output for 5.6.20
running: 3773 exitcode: 1 killing proc_open'ed process running: 3773 exitcode: 0
Output for 5.6.19
running: 21738 exitcode: 1 killing proc_open'ed process running: 21738 exitcode: 0
Output for 5.6.18
running: 11480 exitcode: 1 killing proc_open'ed process running: 11480 exitcode: 0
Output for 5.6.17
running: 27332 exitcode: 1 killing proc_open'ed process running: 27332 exitcode: 0
Output for 5.6.16
running: 31059 exitcode: 1 killing proc_open'ed process running: 31059 exitcode: 0
Output for 5.6.15
running: 27061 exitcode: 1 killing proc_open'ed process running: 27061 exitcode: 0
Output for 5.6.14
running: 30389 exitcode: 1 killing proc_open'ed process running: 30389 exitcode: 0
Output for 5.6.13
running: 16470 exitcode: 1 killing proc_open'ed process running: 16470 exitcode: 0
Output for 5.6.12
running: 11763 exitcode: 1 killing proc_open'ed process running: 11763 exitcode: 0
Output for 5.6.11
running: 1145 exitcode: 1 killing proc_open'ed process running: 1145 exitcode: 0
Output for 5.6.10
running: 20235 exitcode: 1 killing proc_open'ed process running: 20235 exitcode: 0
Output for 5.6.9
running: 22509 exitcode: 1 killing proc_open'ed process running: 22509 exitcode: 0
Output for 5.6.8
running: 26778 exitcode: 1 killing proc_open'ed process running: 26778 exitcode: 0
Output for 5.5.35
running: 22396 exitcode: 1 killing proc_open'ed process running: 22396 exitcode: 0
Output for 5.5.34
running: 4309 exitcode: 1 killing proc_open'ed process running: 4309 exitcode: 0
Output for 5.5.33
running: 20579 exitcode: 1 killing proc_open'ed process running: 20579 exitcode: 0
Output for 5.5.32
running: 1360 exitcode: 1 killing proc_open'ed process running: 1360 exitcode: 0
Output for 5.5.31
running: 23415 exitcode: 1 killing proc_open'ed process running: 23415 exitcode: 0
Output for 5.5.30
running: 1721 exitcode: 1 killing proc_open'ed process running: 1721 exitcode: 0
Output for 5.5.29
running: 7064 exitcode: 1 killing proc_open'ed process running: 7064 exitcode: 0
Output for 5.5.28
running: 29662 exitcode: 1 killing proc_open'ed process running: 29662 exitcode: 0
Output for 5.5.27
running: 15828 exitcode: 1 killing proc_open'ed process running: 15828 exitcode: 0
Output for 5.5.26
running: 5732 exitcode: 1 killing proc_open'ed process running: 5732 exitcode: 0
Output for 5.5.25
running: 8174 exitcode: 1 killing proc_open'ed process running: 8174 exitcode: 0
Output for 5.5.24
running: 23774 exitcode: 1 killing proc_open'ed process running: 23774 exitcode: 0
Output for 5.4.45
running: 31548 exitcode: 1 killing proc_open'ed process running: 31548 exitcode: 0
Output for 5.4.44
running: 30983 exitcode: 1 killing proc_open'ed process running: 30983 exitcode: 0
Output for 5.4.43
running: 30313 exitcode: 1 killing proc_open'ed process running: 30313 exitcode: 0
Output for 5.4.42
running: 30085 exitcode: 1 killing proc_open'ed process running: 30085 exitcode: 0
Output for 5.4.41
running: 29773 exitcode: 1 killing proc_open'ed process running: 29773 exitcode: 0
Output for 5.4.40
running: 29455 exitcode: 1 killing proc_open'ed process running: 29455 exitcode: 0
Output for 5.4.39
running: 29207 exitcode: 1 killing proc_open'ed process running: 29207 exitcode: 0
Output for 5.4.38
running: 30103 exitcode: 1 killing proc_open'ed process running: 30103 exitcode: 0
Output for 5.4.37
running: 29991 exitcode: 1 killing proc_open'ed process running: 29991 exitcode: 0
Output for 5.4.36
running: 29983 exitcode: 1 killing proc_open'ed process running: 29983 exitcode: 0
Output for 5.4.35
running: 29974 exitcode: 1 killing proc_open'ed process running: 29974 exitcode: 0
Output for 5.4.34
running: 29968 exitcode: 1 killing proc_open'ed process running: 29968 exitcode: 0
Output for 5.4.32
running: 14048 exitcode: 1 killing proc_open'ed process running: 14048 exitcode: 0
Output for 5.4.31
running: 13964 exitcode: 1 killing proc_open'ed process running: 13964 exitcode: 0
Output for 5.4.30
running: 13871 exitcode: 1 killing proc_open'ed process running: 13871 exitcode: 0
Output for 5.4.29
running: 13861 exitcode: 1 killing proc_open'ed process running: 13861 exitcode: 0
Output for 5.4.28
running: 13843 exitcode: 1 killing proc_open'ed process running: 13843 exitcode: 0
Output for 5.4.27
running: 13992 exitcode: 1 killing proc_open'ed process running: 13992 exitcode: 0
Output for 5.4.26
running: 24143 exitcode: 1 killing proc_open'ed process running: 24143 exitcode: 0
Output for 5.4.25
running: 24149 exitcode: 1 killing proc_open'ed process running: 24149 exitcode: 0
Output for 5.4.24
running: 24155 exitcode: 1 killing proc_open'ed process running: 24155 exitcode: 0
Output for 5.4.23
running: 24161 exitcode: 1 killing proc_open'ed process running: 24161 exitcode: 0
Output for 5.4.22
running: 24178 exitcode: 1 killing proc_open'ed process running: 24178 exitcode: 0
Output for 5.4.21
running: 24186 exitcode: 1 killing proc_open'ed process running: 24186 exitcode: 0
Output for 5.4.20
running: 24194 exitcode: 1 killing proc_open'ed process running: 24194 exitcode: 0
Output for 5.4.19
running: 24202 exitcode: 1 killing proc_open'ed process running: 24202 exitcode: 0
Output for 5.4.18
running: 24210 exitcode: 1 killing proc_open'ed process running: 24210 exitcode: 0
Output for 5.4.17
running: 24218 exitcode: 1 killing proc_open'ed process running: 24218 exitcode: 0
Output for 5.4.16
running: 24226 exitcode: 1 killing proc_open'ed process running: 24226 exitcode: 0
Output for 5.4.15
running: 24234 exitcode: 1 killing proc_open'ed process running: 24234 exitcode: 0
Output for 5.4.14
running: 24242 exitcode: 1 killing proc_open'ed process running: 24242 exitcode: 0
Output for 5.4.13
running: 24250 exitcode: 1 killing proc_open'ed process running: 24250 exitcode: 0
Output for 5.4.12
running: 24258 exitcode: 1 killing proc_open'ed process running: 24258 exitcode: 0
Output for 5.4.11
running: 24266 exitcode: 1 killing proc_open'ed process running: 24266 exitcode: 0
Output for 5.4.10
running: 24274 exitcode: 1 killing proc_open'ed process running: 24274 exitcode: 0
Output for 5.4.9
running: 24282 exitcode: 1 killing proc_open'ed process running: 24282 exitcode: 0
Output for 5.4.8
running: 24290 exitcode: 1 killing proc_open'ed process running: 24290 exitcode: 0
Output for 5.4.7
running: 24298 exitcode: 1 killing proc_open'ed process running: 24298 exitcode: 0
Output for 5.4.6
running: 24306 exitcode: 1 killing proc_open'ed process running: 24306 exitcode: 0
Output for 5.4.5
running: 24314 exitcode: 1 killing proc_open'ed process running: 24314 exitcode: 0
Output for 5.4.4
running: 24322 exitcode: 1 killing proc_open'ed process running: 24322 exitcode: 0
Output for 5.4.3
running: 24330 exitcode: 1 killing proc_open'ed process running: 24330 exitcode: 0
Output for 5.4.2
running: 24338 exitcode: 1 killing proc_open'ed process running: 24338 exitcode: 0
Output for 5.4.1
running: 24346 exitcode: 1 killing proc_open'ed process running: 24346 exitcode: 0
Output for 5.4.0
running: 24354 exitcode: 1 killing proc_open'ed process running: 24354 exitcode: 0
Output for 5.3.29
running: 13879 exitcode: 1 killing proc_open'ed process running: 13879 exitcode: 0
Output for 5.3.28
running: 24362 exitcode: 1 killing proc_open'ed process running: 24362 exitcode: 0
Output for 5.3.27
running: 24389 exitcode: 1 killing proc_open'ed process running: 24389 exitcode: 0
Output for 5.3.26
running: 24396 exitcode: 1 killing proc_open'ed process running: 24396 exitcode: 0
Output for 5.3.25
running: 24402 exitcode: 1 killing proc_open'ed process running: 24402 exitcode: 0
Output for 5.3.24
running: 24408 exitcode: 1 killing proc_open'ed process running: 24408 exitcode: 0
Output for 5.3.23
running: 24414 exitcode: 1 killing proc_open'ed process running: 24414 exitcode: 0
Output for 5.3.22
running: 24420 exitcode: 1 killing proc_open'ed process running: 24420 exitcode: 0
Output for 5.3.21
running: 24426 exitcode: 1 killing proc_open'ed process running: 24426 exitcode: 0
Output for 5.3.20
running: 24432 exitcode: 1 killing proc_open'ed process running: 24432 exitcode: 0
Output for 5.3.19
running: 24438 exitcode: 1 killing proc_open'ed process running: 24438 exitcode: 0
Output for 5.3.18
running: 24444 exitcode: 1 killing proc_open'ed process running: 24444 exitcode: 0
Output for 5.3.17
running: 24450 exitcode: 1 killing proc_open'ed process running: 24450 exitcode: 0
Output for 5.3.16
running: 24456 exitcode: 1 killing proc_open'ed process running: 24456 exitcode: 0
Output for 5.3.15
running: 24462 exitcode: 1 killing proc_open'ed process running: 24462 exitcode: 0
Output for 5.3.14
running: 24468 exitcode: 1 killing proc_open'ed process running: 24468 exitcode: 0
Output for 5.3.13
running: 24474 exitcode: 1 killing proc_open'ed process running: 24474 exitcode: 0
Output for 5.3.12
running: 24480 exitcode: 1 killing proc_open'ed process running: 24480 exitcode: 0
Output for 5.3.11
running: 24486 exitcode: 1 killing proc_open'ed process running: 24486 exitcode: 0
Output for 5.3.10
running: 24492 exitcode: 1 killing proc_open'ed process running: 24492 exitcode: 0
Output for 5.3.9
running: 24498 exitcode: 1 killing proc_open'ed process running: 24498 exitcode: 0
Output for 5.3.8
running: 24504 exitcode: 1 killing proc_open'ed process running: 24504 exitcode: 0
Output for 5.3.7
running: 24510 exitcode: 1 killing proc_open'ed process running: 24510 exitcode: 0
Output for 5.3.6
running: 24516 exitcode: 1 killing proc_open'ed process running: 24516 exitcode: 0
Output for 5.3.5
running: 24522 exitcode: 1 killing proc_open'ed process running: 24522 exitcode: 0
Output for 5.3.4
running: 24542 exitcode: 1 killing proc_open'ed process running: 24542 exitcode: 0
Output for 5.3.3
running: 24566 exitcode: 1 killing proc_open'ed process running: 24566 exitcode: 0
Output for 5.3.2
running: 24593 exitcode: 1 killing proc_open'ed process running: 24593 exitcode: 0
Output for 5.3.1
running: 24619 exitcode: 1 killing proc_open'ed process running: 24619 exitcode: 0
Output for 5.3.0
running: 24650 exitcode: 1 killing proc_open'ed process running: 24650 exitcode: 0
Output for 5.2.17
running: 24690 exitcode: 1 killing proc_open'ed process running: 24690 exitcode: 0
Output for 5.2.16
running: 24696 exitcode: 1 killing proc_open'ed process running: 24696 exitcode: 0
Output for 5.2.15
running: 24702 exitcode: 1 killing proc_open'ed process running: 24702 exitcode: 0
Output for 5.2.14
running: 24708 exitcode: 1 killing proc_open'ed process running: 24708 exitcode: 0
Output for 5.2.13
running: 24714 exitcode: 1 killing proc_open'ed process running: 24714 exitcode: 0
Output for 5.2.12
running: 24720 exitcode: 1 killing proc_open'ed process running: 24720 exitcode: 0
Output for 5.2.11
running: 24726 exitcode: 1 killing proc_open'ed process running: 24726 exitcode: 0
Output for 5.2.10
running: 24732 exitcode: 1 killing proc_open'ed process running: 24732 exitcode: 0
Output for 5.2.9
running: 24764 exitcode: 1 killing proc_open'ed process running: 24764 exitcode: 0
Output for 5.2.8
running: 24790 exitcode: 1 killing proc_open'ed process running: 24790 exitcode: 0
Output for 5.2.7
running: 24837 exitcode: 1 killing proc_open'ed process running: 24837 exitcode: 0
Output for 5.2.6
running: 24866 exitcode: 1 killing proc_open'ed process running: 24866 exitcode: 0
Output for 5.2.5
running: 24906 exitcode: 1 killing proc_open'ed process running: 24906 exitcode: 0
Output for 5.2.4
running: 24914 exitcode: 1 killing proc_open'ed process running: 24914 exitcode: 0
Output for 5.2.3
running: 24918 exitcode: 1 killing proc_open'ed process running: 24918 exitcode: 0
Output for 5.2.2
running: 24922 exitcode: 1 killing proc_open'ed process running: 24922 exitcode: 0
Output for 5.2.1
running: 24926 exitcode: 1 killing proc_open'ed process running: 24926 exitcode: 0
Output for 5.2.0
running: 24957 exitcode: 1 killing proc_open'ed process running: 24957 exitcode: 0
Output for 5.1.6
running: 24983 exitcode: 1 killing proc_open'ed process running: 24983 exitcode: 0
Output for 5.1.5
running: 25009 exitcode: 1 killing proc_open'ed process running: 25009 exitcode: 0
Output for 5.1.4
running: 25037 exitcode: 1 killing proc_open'ed process running: 25037 exitcode: 0
Output for 5.1.3
running: 25078 exitcode: 1 killing proc_open'ed process running: 25078 exitcode: 0
Output for 5.1.2
running: 25082 exitcode: 1 killing proc_open'ed process running: 25082 exitcode: 0
Output for 5.1.1
running: 25086 exitcode: 1 killing proc_open'ed process running: 25086 exitcode: 0
Output for 5.1.0
running: 25090 exitcode: 1 killing proc_open'ed process running: 25090 exitcode: 0
Output for 5.0.5
running: 25094 exitcode: 1 killing proc_open'ed process running: 25094 exitcode: 0
Output for 5.0.4
running: 25119 exitcode: 0 killing proc_open'ed process running: 25119 exitcode: 1
Output for 5.0.3
running: 25145 exitcode: 1 killing proc_open'ed process running: 25145 exitcode: 1
Output for 5.0.2
running: 25171 exitcode: 1 killing proc_open'ed process running: 25171 exitcode: 1
Output for 5.0.1
running: 25198 exitcode: 1 killing proc_open'ed process running: 25198 exitcode: 1
Output for 5.0.0
running: 25233 exitcode: 1 killing proc_open'ed process running: 25233 exitcode: 1
Output for 4.3.0 - 4.4.9
Warning: proc_open() expects exactly 3 parameters, 4 given in /in/UJNKJ on line 20 proc_open failed for command /bin/bash -c "sleep 30"