3v4l.org

run code in 200+ 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.2.0
running: 10776 exitcode: 1 killing proc_open'ed process running: 10776 exitcode: 0
Output for 7.1.7
running: 11980 exitcode: 0 killing proc_open'ed process running: 11980 exitcode: 0
Output for 7.1.6
running: 4552 exitcode: 1 killing proc_open'ed process running: 4552 exitcode: 0
Output for 7.1.5
running: 2922 exitcode: 1 killing proc_open'ed process running: 2922 exitcode: 0
Output for 7.1.0
running: 956 exitcode: 1 killing proc_open'ed process running: 956 exitcode: 0
Output for 7.0.20
running: 10207 exitcode: 1 killing proc_open'ed process running: 10207 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 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: 30303 exitcode: 1 killing proc_open'ed process running: 30303 exitcode: 0
Output for 5.4.25
running: 30301 exitcode: 1 killing proc_open'ed process running: 30301 exitcode: 0
Output for 5.4.24
running: 30299 exitcode: 1 killing proc_open'ed process running: 30299 exitcode: 0
Output for 5.4.23
running: 30297 exitcode: 1 killing proc_open'ed process running: 30297 exitcode: 0
Output for 5.4.22
running: 30293 exitcode: 1 killing proc_open'ed process running: 30293 exitcode: 0
Output for 5.4.21
running: 30291 exitcode: 1 killing proc_open'ed process running: 30291 exitcode: 0
Output for 5.4.20
running: 30289 exitcode: 1 killing proc_open'ed process running: 30289 exitcode: 0
Output for 5.4.19
running: 30287 exitcode: 1 killing proc_open'ed process running: 30287 exitcode: 0
Output for 5.4.18
running: 30285 exitcode: 1 killing proc_open'ed process running: 30285 exitcode: 0
Output for 5.4.17
running: 30281 exitcode: 1 killing proc_open'ed process running: 30281 exitcode: 0
Output for 5.4.16
running: 30277 exitcode: 1 killing proc_open'ed process running: 30277 exitcode: 0
Output for 5.4.15
running: 30273 exitcode: 1 killing proc_open'ed process running: 30273 exitcode: 0
Output for 5.4.14
running: 30271 exitcode: 1 killing proc_open'ed process running: 30271 exitcode: 0
Output for 5.4.13
running: 30267 exitcode: 1 killing proc_open'ed process running: 30267 exitcode: 0
Output for 5.4.12
running: 30263 exitcode: 1 killing proc_open'ed process running: 30263 exitcode: 0
Output for 5.4.11
running: 30257 exitcode: 1 killing proc_open'ed process running: 30257 exitcode: 0
Output for 5.4.10
running: 30253 exitcode: 1 killing proc_open'ed process running: 30253 exitcode: 0
Output for 5.4.9
running: 30251 exitcode: 1 killing proc_open'ed process running: 30251 exitcode: 0
Output for 5.4.8
running: 30245 exitcode: 1 killing proc_open'ed process running: 30245 exitcode: 0
Output for 5.4.7
running: 30241 exitcode: 1 killing proc_open'ed process running: 30241 exitcode: 0
Output for 5.4.6
running: 30239 exitcode: 1 killing proc_open'ed process running: 30239 exitcode: 0
Output for 5.4.5
running: 30233 exitcode: 1 killing proc_open'ed process running: 30233 exitcode: 0
Output for 5.4.4
running: 30229 exitcode: 1 killing proc_open'ed process running: 30229 exitcode: 0
Output for 5.4.3
running: 30227 exitcode: 1 killing proc_open'ed process running: 30227 exitcode: 0
Output for 5.4.2
running: 30221 exitcode: 1 killing proc_open'ed process running: 30221 exitcode: 0
Output for 5.4.1
running: 30217 exitcode: 1 killing proc_open'ed process running: 30217 exitcode: 0
Output for 5.4.0
running: 30215 exitcode: 1 killing proc_open'ed process running: 30215 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: 30295 exitcode: 1 killing proc_open'ed process running: 30295 exitcode: 0
Output for 5.3.27
running: 30283 exitcode: 1 killing proc_open'ed process running: 30283 exitcode: 0
Output for 5.3.26
running: 30279 exitcode: 1 killing proc_open'ed process running: 30279 exitcode: 0
Output for 5.3.25
running: 30275 exitcode: 1 killing proc_open'ed process running: 30275 exitcode: 0
Output for 5.3.24
running: 30269 exitcode: 1 killing proc_open'ed process running: 30269 exitcode: 0
Output for 5.3.23
running: 30265 exitcode: 1 killing proc_open'ed process running: 30265 exitcode: 0
Output for 5.3.22
running: 30261 exitcode: 1 killing proc_open'ed process running: 30261 exitcode: 0
Output for 5.3.21
running: 30259 exitcode: 1 killing proc_open'ed process running: 30259 exitcode: 0
Output for 5.3.20
running: 30255 exitcode: 1 killing proc_open'ed process running: 30255 exitcode: 0
Output for 5.3.19
running: 30249 exitcode: 1 killing proc_open'ed process running: 30249 exitcode: 0
Output for 5.3.18
running: 30247 exitcode: 1 killing proc_open'ed process running: 30247 exitcode: 0
Output for 5.3.17
running: 30243 exitcode: 1 killing proc_open'ed process running: 30243 exitcode: 0
Output for 5.3.16
running: 30237 exitcode: 1 killing proc_open'ed process running: 30237 exitcode: 0
Output for 5.3.15
running: 30235 exitcode: 1 killing proc_open'ed process running: 30235 exitcode: 0
Output for 5.3.14
running: 30231 exitcode: 1 killing proc_open'ed process running: 30231 exitcode: 0
Output for 5.3.13
running: 30225 exitcode: 1 killing proc_open'ed process running: 30225 exitcode: 0
Output for 5.3.12
running: 30223 exitcode: 1 killing proc_open'ed process running: 30223 exitcode: 0
Output for 5.3.11
running: 30219 exitcode: 1 killing proc_open'ed process running: 30219 exitcode: 0
Output for 5.3.10
running: 30213 exitcode: 1 killing proc_open'ed process running: 30213 exitcode: 0
Output for 5.3.9
running: 30211 exitcode: 1 killing proc_open'ed process running: 30211 exitcode: 0
Output for 5.3.8
running: 30209 exitcode: 1 killing proc_open'ed process running: 30209 exitcode: 0
Output for 5.3.7
running: 30207 exitcode: 1 killing proc_open'ed process running: 30207 exitcode: 0
Output for 5.3.6
running: 30205 exitcode: 1 killing proc_open'ed process running: 30205 exitcode: 0
Output for 5.3.5
running: 30203 exitcode: 1 killing proc_open'ed process running: 30203 exitcode: 0
Output for 5.3.4
running: 30197 exitcode: 1 killing proc_open'ed process running: 30197 exitcode: 0
Output for 5.3.3
running: 30193 exitcode: 1 killing proc_open'ed process running: 30193 exitcode: 0
Output for 5.3.2
running: 30189 exitcode: 1 killing proc_open'ed process running: 30189 exitcode: 0
Output for 5.3.1
running: 30183 exitcode: 1 killing proc_open'ed process running: 30183 exitcode: 0
Output for 5.3.0
running: 30179 exitcode: 1 killing proc_open'ed process running: 30179 exitcode: 0
Output for 5.2.17
running: 30201 exitcode: 1 killing proc_open'ed process running: 30201 exitcode: 0
Output for 5.2.16
running: 30199 exitcode: 1 killing proc_open'ed process running: 30199 exitcode: 0
Output for 5.2.15
running: 30195 exitcode: 1 killing proc_open'ed process running: 30195 exitcode: 0
Output for 5.2.14
running: 30191 exitcode: 1 killing proc_open'ed process running: 30191 exitcode: 0
Output for 5.2.13
running: 30187 exitcode: 1 killing proc_open'ed process running: 30187 exitcode: 0
Output for 5.2.12
running: 30185 exitcode: 1 killing proc_open'ed process running: 30185 exitcode: 0
Output for 5.2.11
running: 30181 exitcode: 1 killing proc_open'ed process running: 30181 exitcode: 0
Output for 5.2.10
running: 30177 exitcode: 1 killing proc_open'ed process running: 30177 exitcode: 0
Output for 5.2.9
running: 30175 exitcode: 1 killing proc_open'ed process running: 30175 exitcode: 0
Output for 5.2.8
running: 30173 exitcode: 1 killing proc_open'ed process running: 30173 exitcode: 0
Output for 5.2.7
running: 30171 exitcode: 1 killing proc_open'ed process running: 30171 exitcode: 0
Output for 5.2.6
running: 30168 exitcode: 1 killing proc_open'ed process running: 30168 exitcode: 0
Output for 5.2.5
running: 30165 exitcode: 1 killing proc_open'ed process running: 30165 exitcode: 0
Output for 5.2.4
running: 30163 exitcode: 1 killing proc_open'ed process running: 30163 exitcode: 0
Output for 5.2.3
running: 30161 exitcode: 1 killing proc_open'ed process running: 30161 exitcode: 0
Output for 5.2.2
running: 30159 exitcode: 1 killing proc_open'ed process running: 30159 exitcode: 0
Output for 5.2.1
running: 30154 exitcode: 1 killing proc_open'ed process running: 30154 exitcode: 0
Output for 5.2.0
running: 30152 exitcode: 1 killing proc_open'ed process running: 30152 exitcode: 0
Output for 5.1.6
running: 30150 exitcode: 1 killing proc_open'ed process running: 30150 exitcode: 0
Output for 5.1.5
running: 30147 exitcode: 1 killing proc_open'ed process running: 30147 exitcode: 0
Output for 5.1.4
running: 30144 exitcode: 1 killing proc_open'ed process running: 30144 exitcode: 0
Output for 5.1.3
running: 30142 exitcode: 1 killing proc_open'ed process running: 30142 exitcode: 0
Output for 5.1.2
running: 30140 exitcode: 1 killing proc_open'ed process running: 30140 exitcode: 0
Output for 5.1.1
running: 30137 exitcode: 1 killing proc_open'ed process running: 30137 exitcode: 0
Output for 5.1.0
running: 30135 exitcode: 1 killing proc_open'ed process running: 30135 exitcode: 0
Output for 5.0.5
running: 30132 exitcode: 0 killing proc_open'ed process running: 30132 exitcode: 0
Output for 5.0.4
running: 30129 exitcode: 0 killing proc_open'ed process running: 30129 exitcode: 1
Output for 5.0.3
running: 30126 exitcode: 1 killing proc_open'ed process running: 30126 exitcode: 1
Output for 5.0.2
running: 30123 exitcode: 1 killing proc_open'ed process running: 30123 exitcode: 0
Output for 5.0.1
running: 30120 exitcode: 1 killing proc_open'ed process running: 30120 exitcode: 0
Output for 5.0.0
running: 30118 exitcode: 1 killing proc_open'ed process running: 30118 exitcode: 0
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"