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("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.0
pid: 944 running: 1 exitcode: -1 killing proc_open'ed process pid: 944 running: 0 exitcode: 127
Output for 7.0.14
pid: 31821 running: 1 exitcode: -1 killing proc_open'ed process pid: 31821 running: 0 exitcode: 127
Output for 7.0.6
pid: 9972 running: 1 exitcode: -1 killing proc_open'ed process pid: 9972 running: 0 exitcode: -1
Output for 7.0.5
pid: 16538 running: 1 exitcode: -1 killing proc_open'ed process pid: 16538 running: 0 exitcode: -1
Output for 7.0.4
pid: 21790 running: 1 exitcode: -1 killing proc_open'ed process pid: 21790 running: 0 exitcode: 127
Output for 7.0.3
pid: 29387 running: 1 exitcode: -1 killing proc_open'ed process pid: 29387 running: 0 exitcode: 127
Output for 7.0.2
pid: 24534 running: 1 exitcode: -1 killing proc_open'ed process pid: 24534 running: 0 exitcode: 127
Output for 7.0.1
pid: 11079 running: 1 exitcode: -1 killing proc_open'ed process pid: 11079 running: 0 exitcode: 127
Output for 7.0.0
pid: 4350 running: 1 exitcode: -1 killing proc_open'ed process pid: 4350 running: 0 exitcode: 127
Output for 5.6.28
pid: 24218 running: 1 exitcode: -1 killing proc_open'ed process pid: 24218 running: 0 exitcode: -1
Output for 5.6.21
pid: 11346 running: 1 exitcode: -1 killing proc_open'ed process pid: 11346 running: 0 exitcode: -1
Output for 5.6.20
pid: 3740 running: 1 exitcode: -1 killing proc_open'ed process pid: 3740 running: 0 exitcode: -1
Output for 5.6.19
pid: 20064 running: 1 exitcode: -1 killing proc_open'ed process pid: 20064 running: 0 exitcode: -1
Output for 5.6.18
pid: 10039 running: 1 exitcode: -1 killing proc_open'ed process pid: 10039 running: 0 exitcode: -1
Output for 5.6.17
pid: 25910 running: 1 exitcode: -1 killing proc_open'ed process pid: 25910 running: 0 exitcode: -1
Output for 5.6.16
pid: 30332 running: 1 exitcode: -1 killing proc_open'ed process pid: 30332 running: 0 exitcode: -1
Output for 5.6.15
pid: 26496 running: 1 exitcode: -1 killing proc_open'ed process pid: 26496 running: 0 exitcode: -1
Output for 5.6.14
pid: 30346 running: 1 exitcode: -1 killing proc_open'ed process pid: 30346 running: 0 exitcode: -1
Output for 5.6.13
pid: 17211 running: 1 exitcode: -1 killing proc_open'ed process pid: 17211 running: 0 exitcode: -1
Output for 5.6.12
pid: 12553 running: 1 exitcode: -1 killing proc_open'ed process pid: 12553 running: 0 exitcode: -1
Output for 5.6.11
pid: 1966 running: 1 exitcode: -1 killing proc_open'ed process pid: 1966 running: 0 exitcode: -1
Output for 5.6.10
pid: 21162 running: 1 exitcode: -1 killing proc_open'ed process pid: 21162 running: 0 exitcode: -1
Output for 5.6.9
pid: 23507 running: 1 exitcode: -1 killing proc_open'ed process pid: 23507 running: 0 exitcode: -1
Output for 5.6.8
pid: 27803 running: 1 exitcode: -1 killing proc_open'ed process pid: 27803 running: 0 exitcode: -1
Output for 5.6.7
pid: 2309 running: 1 exitcode: -1 killing proc_open'ed process pid: 2309 running: 0 exitcode: -1
Output for 5.5.35
pid: 23033 running: 1 exitcode: -1 killing proc_open'ed process pid: 23033 running: 0 exitcode: -1
Output for 5.5.34
pid: 4277 running: 1 exitcode: -1 killing proc_open'ed process pid: 4277 running: 0 exitcode: -1
Output for 5.5.33
pid: 18901 running: 1 exitcode: -1 killing proc_open'ed process pid: 18901 running: 0 exitcode: -1
Output for 5.5.32
pid: 32402 running: 1 exitcode: -1 killing proc_open'ed process pid: 32402 running: 0 exitcode: -1
Output for 5.5.31
pid: 21991 running: 1 exitcode: -1 killing proc_open'ed process pid: 21991 running: 0 exitcode: -1
Output for 5.5.30
pid: 1571 running: 1 exitcode: -1 killing proc_open'ed process pid: 1571 running: 0 exitcode: -1
Output for 5.5.29
pid: 7813 running: 1 exitcode: -1 killing proc_open'ed process pid: 7813 running: 0 exitcode: -1
Output for 5.5.28
pid: 30450 running: 1 exitcode: -1 killing proc_open'ed process pid: 30450 running: 0 exitcode: -1
Output for 5.5.27
pid: 16614 running: 1 exitcode: -1 killing proc_open'ed process pid: 16614 running: 0 exitcode: -1
Output for 5.5.26
pid: 6689 running: 1 exitcode: -1 killing proc_open'ed process pid: 6689 running: 0 exitcode: -1
Output for 5.5.25
pid: 9206 running: 1 exitcode: -1 killing proc_open'ed process pid: 9206 running: 0 exitcode: -1
Output for 5.5.24
pid: 26870 running: 1 exitcode: -1 killing proc_open'ed process pid: 26870 running: 0 exitcode: -1
Output for 5.4.45
pid: 32389 running: 1 exitcode: -1 killing proc_open'ed process pid: 32389 running: 0 exitcode: -1
Output for 5.4.44
pid: 32399 running: 1 exitcode: -1 killing proc_open'ed process pid: 32399 running: 0 exitcode: -1
Output for 5.4.43
pid: 32413 running: 1 exitcode: -1 killing proc_open'ed process pid: 32413 running: 0 exitcode: -1
Output for 5.4.42
pid: 32421 running: 1 exitcode: -1 killing proc_open'ed process pid: 32421 running: 0 exitcode: -1
Output for 5.4.41
pid: 32425 running: 1 exitcode: -1 killing proc_open'ed process pid: 32425 running: 0 exitcode: -1
Output for 5.4.40
pid: 32437 running: 1 exitcode: -1 killing proc_open'ed process pid: 32437 running: 0 exitcode: -1
Output for 5.4.39
pid: 32443 running: 1 exitcode: -1 killing proc_open'ed process pid: 32443 running: 0 exitcode: -1
Output for 5.4.38
pid: 32447 running: 1 exitcode: -1 killing proc_open'ed process pid: 32447 running: 0 exitcode: -1
Output for 5.4.37
pid: 32457 running: 1 exitcode: -1 killing proc_open'ed process pid: 32457 running: 0 exitcode: -1
Output for 5.4.36
pid: 32459 running: 1 exitcode: -1 killing proc_open'ed process pid: 32459 running: 0 exitcode: -1
Output for 5.4.35
pid: 32465 running: 1 exitcode: -1 killing proc_open'ed process pid: 32465 running: 0 exitcode: -1
Output for 5.4.34
pid: 32473 running: 1 exitcode: -1 killing proc_open'ed process pid: 32473 running: 0 exitcode: -1
Output for 5.4.32
pid: 32483 running: 1 exitcode: -1 killing proc_open'ed process pid: 32483 running: 0 exitcode: -1
Output for 5.4.31
pid: 32487 running: 1 exitcode: -1 killing proc_open'ed process pid: 32487 running: 0 exitcode: -1
Output for 5.4.30
pid: 32493 running: 1 exitcode: -1 killing proc_open'ed process pid: 32493 running: 0 exitcode: -1
Output for 5.4.29
pid: 32495 running: 1 exitcode: -1 killing proc_open'ed process pid: 32495 running: 0 exitcode: -1
Output for 5.4.28
pid: 32499 running: 1 exitcode: -1 killing proc_open'ed process pid: 32499 running: 0 exitcode: -1
Output for 5.4.27
pid: 32503 running: 1 exitcode: -1 killing proc_open'ed process pid: 32503 running: 0 exitcode: -1
Output for 5.4.26
pid: 32507 running: 1 exitcode: -1 killing proc_open'ed process pid: 32507 running: 0 exitcode: -1
Output for 5.4.25
pid: 32511 running: 1 exitcode: -1 killing proc_open'ed process pid: 32511 running: 0 exitcode: -1
Output for 5.4.24
pid: 32517 running: 1 exitcode: -1 killing proc_open'ed process pid: 32517 running: 0 exitcode: -1
Output for 5.4.23
pid: 32519 running: 1 exitcode: -1 killing proc_open'ed process pid: 32519 running: 0 exitcode: -1
Output for 5.4.22
pid: 32527 running: 1 exitcode: -1 killing proc_open'ed process pid: 32527 running: 0 exitcode: -1
Output for 5.4.21
pid: 32529 running: 1 exitcode: -1 killing proc_open'ed process pid: 32529 running: 0 exitcode: -1
Output for 5.4.20
pid: 32533 running: 1 exitcode: -1 killing proc_open'ed process pid: 32533 running: 0 exitcode: -1
Output for 5.4.19
pid: 32539 running: 1 exitcode: -1 killing proc_open'ed process pid: 32539 running: 0 exitcode: -1
Output for 5.4.18
pid: 32543 running: 1 exitcode: -1 killing proc_open'ed process pid: 32543 running: 0 exitcode: -1
Output for 5.4.17
pid: 32549 running: 1 exitcode: -1 killing proc_open'ed process pid: 32549 running: 0 exitcode: -1
Output for 5.4.16
pid: 32555 running: 1 exitcode: -1 killing proc_open'ed process pid: 32555 running: 0 exitcode: -1
Output for 5.4.15
pid: 32557 running: 1 exitcode: -1 killing proc_open'ed process pid: 32557 running: 0 exitcode: -1
Output for 5.4.14
pid: 32561 running: 1 exitcode: -1 killing proc_open'ed process pid: 32561 running: 0 exitcode: -1
Output for 5.4.13
pid: 32565 running: 1 exitcode: -1 killing proc_open'ed process pid: 32565 running: 0 exitcode: -1
Output for 5.4.12
pid: 32569 running: 1 exitcode: -1 killing proc_open'ed process pid: 32569 running: 0 exitcode: -1
Output for 5.4.11
pid: 32575 running: 1 exitcode: -1 killing proc_open'ed process pid: 32575 running: 0 exitcode: -1
Output for 5.4.10
pid: 32579 running: 1 exitcode: -1 killing proc_open'ed process pid: 32579 running: 0 exitcode: -1
Output for 5.4.9
pid: 32581 running: 1 exitcode: -1 killing proc_open'ed process pid: 32581 running: 0 exitcode: -1
Output for 5.4.8
pid: 32587 running: 1 exitcode: -1 killing proc_open'ed process pid: 32587 running: 0 exitcode: -1
Output for 5.4.7
pid: 32591 running: 1 exitcode: -1 killing proc_open'ed process pid: 32591 running: 0 exitcode: -1
Output for 5.4.6
pid: 32593 running: 1 exitcode: -1 killing proc_open'ed process pid: 32593 running: 0 exitcode: -1
Output for 5.4.5
pid: 32599 running: 1 exitcode: -1 killing proc_open'ed process pid: 32599 running: 0 exitcode: -1
Output for 5.4.4
pid: 32603 running: 1 exitcode: -1 killing proc_open'ed process pid: 32603 running: 0 exitcode: -1
Output for 5.4.3
pid: 32605 running: 1 exitcode: -1 killing proc_open'ed process pid: 32605 running: 0 exitcode: -1
Output for 5.4.2
pid: 32611 running: 1 exitcode: -1 killing proc_open'ed process pid: 32611 running: 0 exitcode: -1
Output for 5.4.1
pid: 32615 running: 1 exitcode: -1 killing proc_open'ed process pid: 32615 running: 0 exitcode: -1
Output for 5.4.0
pid: 32617 running: 1 exitcode: -1 killing proc_open'ed process pid: 32617 running: 0 exitcode: -1
Output for 5.3.29
pid: 32485 running: 1 exitcode: -1 killing proc_open'ed process pid: 32485 running: 0 exitcode: -1
Output for 5.3.28
pid: 32523 running: 1 exitcode: -1 killing proc_open'ed process pid: 32523 running: 0 exitcode: -1
Output for 5.3.27
pid: 32547 running: 1 exitcode: -1 killing proc_open'ed process pid: 32547 running: 0 exitcode: -1
Output for 5.3.26
pid: 32553 running: 1 exitcode: -1 killing proc_open'ed process pid: 32553 running: 0 exitcode: -1
Output for 5.3.25
pid: 32559 running: 1 exitcode: -1 killing proc_open'ed process pid: 32559 running: 0 exitcode: -1
Output for 5.3.24
pid: 32563 running: 1 exitcode: -1 killing proc_open'ed process pid: 32563 running: 0 exitcode: -1
Output for 5.3.23
pid: 32567 running: 1 exitcode: -1 killing proc_open'ed process pid: 32567 running: 0 exitcode: -1
Output for 5.3.22
pid: 32571 running: 1 exitcode: -1 killing proc_open'ed process pid: 32571 running: 0 exitcode: -1
Output for 5.3.21
pid: 32573 running: 1 exitcode: -1 killing proc_open'ed process pid: 32573 running: 0 exitcode: -1
Output for 5.3.20
pid: 32577 running: 1 exitcode: -1 killing proc_open'ed process pid: 32577 running: 0 exitcode: -1
Output for 5.3.19
pid: 32583 running: 1 exitcode: -1 killing proc_open'ed process pid: 32583 running: 0 exitcode: -1
Output for 5.3.18
pid: 32585 running: 1 exitcode: -1 killing proc_open'ed process pid: 32585 running: 0 exitcode: -1
Output for 5.3.17
pid: 32589 running: 1 exitcode: -1 killing proc_open'ed process pid: 32589 running: 0 exitcode: -1
Output for 5.3.16
pid: 32595 running: 1 exitcode: -1 killing proc_open'ed process pid: 32595 running: 0 exitcode: -1
Output for 5.3.15
pid: 32597 running: 1 exitcode: -1 killing proc_open'ed process pid: 32597 running: 0 exitcode: -1
Output for 5.3.14
pid: 32601 running: 1 exitcode: -1 killing proc_open'ed process pid: 32601 running: 0 exitcode: -1
Output for 5.3.13
pid: 32607 running: 1 exitcode: -1 killing proc_open'ed process pid: 32607 running: 0 exitcode: -1
Output for 5.3.12
pid: 32609 running: 1 exitcode: -1 killing proc_open'ed process pid: 32609 running: 0 exitcode: -1
Output for 5.3.11
pid: 32613 running: 1 exitcode: -1 killing proc_open'ed process pid: 32613 running: 0 exitcode: -1
Output for 5.3.10
pid: 32619 running: 1 exitcode: -1 killing proc_open'ed process pid: 32619 running: 0 exitcode: -1
Output for 5.3.9
pid: 32621 running: 1 exitcode: -1 killing proc_open'ed process pid: 32621 running: 0 exitcode: -1
Output for 5.3.8
pid: 32623 running: 1 exitcode: -1 killing proc_open'ed process pid: 32623 running: 0 exitcode: -1
Output for 5.3.7
pid: 32625 running: 1 exitcode: -1 killing proc_open'ed process pid: 32625 running: 0 exitcode: -1
Output for 5.3.6
pid: 32627 running: 1 exitcode: -1 killing proc_open'ed process pid: 32627 running: 0 exitcode: -1
Output for 5.3.5
pid: 32629 running: 1 exitcode: -1 killing proc_open'ed process pid: 32629 running: 0 exitcode: -1
Output for 5.3.4
pid: 32635 running: 1 exitcode: -1 killing proc_open'ed process pid: 32635 running: 0 exitcode: -1
Output for 5.3.3
pid: 32639 running: 1 exitcode: -1 killing proc_open'ed process pid: 32639 running: 0 exitcode: -1
Output for 5.3.2
pid: 32643 running: 1 exitcode: -1 killing proc_open'ed process pid: 32643 running: 0 exitcode: -1
Output for 5.3.1
pid: 32649 running: 1 exitcode: -1 killing proc_open'ed process pid: 32649 running: 0 exitcode: -1
Output for 5.3.0
pid: 32653 running: 1 exitcode: -1 killing proc_open'ed process pid: 32653 running: 0 exitcode: -1
Output for 5.2.17
pid: 32631 running: 1 exitcode: -1 killing proc_open'ed process pid: 32631 running: 0 exitcode: -1
Output for 5.2.16
pid: 32633 running: 1 exitcode: -1 killing proc_open'ed process pid: 32633 running: 0 exitcode: -1
Output for 5.2.15
pid: 32637 running: 1 exitcode: -1 killing proc_open'ed process pid: 32637 running: 0 exitcode: -1
Output for 5.2.14
pid: 32641 running: 1 exitcode: -1 killing proc_open'ed process pid: 32641 running: 0 exitcode: -1
Output for 5.2.13
pid: 32645 running: 1 exitcode: -1 killing proc_open'ed process pid: 32645 running: 0 exitcode: -1
Output for 5.2.12
pid: 32647 running: 1 exitcode: -1 killing proc_open'ed process pid: 32647 running: 0 exitcode: -1
Output for 5.2.11
pid: 32651 running: 1 exitcode: -1 killing proc_open'ed process pid: 32651 running: 0 exitcode: -1
Output for 5.2.10
pid: 32655 running: 1 exitcode: -1 killing proc_open'ed process pid: 32655 running: 0 exitcode: -1
Output for 5.2.9
pid: 32657 running: 1 exitcode: -1 killing proc_open'ed process pid: 32657 running: 0 exitcode: -1
Output for 5.2.8
pid: 32659 running: 1 exitcode: -1 killing proc_open'ed process pid: 32659 running: 0 exitcode: -1
Output for 5.2.7
pid: 32661 running: 1 exitcode: -1 killing proc_open'ed process pid: 32661 running: 0 exitcode: -1
Output for 5.2.6
pid: 32664 running: 1 exitcode: -1 killing proc_open'ed process pid: 32664 running: 0 exitcode: -1
Output for 5.2.5
pid: 32667 running: 1 exitcode: -1 killing proc_open'ed process pid: 32667 running: 0 exitcode: -1
Output for 5.2.4
pid: 32669 running: 1 exitcode: -1 killing proc_open'ed process pid: 32669 running: 0 exitcode: -1
Output for 5.2.3
pid: 32671 running: 1 exitcode: -1 killing proc_open'ed process pid: 32671 running: 0 exitcode: -1
Output for 5.2.2
pid: 32673 running: 1 exitcode: -1 killing proc_open'ed process pid: 32673 running: 0 exitcode: -1
Output for 5.2.1
pid: 32678 running: 1 exitcode: -1 killing proc_open'ed process pid: 32678 running: 0 exitcode: -1
Output for 5.2.0
pid: 32680 running: 1 exitcode: -1 killing proc_open'ed process pid: 32680 running: 0 exitcode: -1
Output for 5.1.6
pid: 32682 running: 1 exitcode: -1 killing proc_open'ed process pid: 32682 running: 0 exitcode: -1
Output for 5.1.5
pid: 32685 running: 1 exitcode: -1 killing proc_open'ed process pid: 32685 running: 0 exitcode: -1
Output for 5.1.4
pid: 32688 running: 1 exitcode: -1 killing proc_open'ed process pid: 32688 running: 0 exitcode: -1
Output for 5.1.3
pid: 32690 running: 1 exitcode: -1 killing proc_open'ed process pid: 32690 running: 0 exitcode: -1
Output for 5.1.2
pid: 32692 running: 1 exitcode: -1 killing proc_open'ed process pid: 32692 running: 0 exitcode: -1
Output for 5.1.1
pid: 32695 running: 1 exitcode: -1 killing proc_open'ed process pid: 32695 running: 0 exitcode: -1
Output for 5.1.0
pid: 32697 running: 1 exitcode: -1 killing proc_open'ed process pid: 32697 running: 0 exitcode: -1
Output for 5.0.5
pid: 32700 running: 1 exitcode: -1 killing proc_open'ed process pid: 32700 running: 0 exitcode: -1
Output for 5.0.4
pid: 32703 running: 0 exitcode: -1 killing proc_open'ed process pid: 32703 running: 1 exitcode: -1
Output for 5.0.3
pid: 32706 running: 1 exitcode: -1 killing proc_open'ed process pid: 32706 running: 1 exitcode: -1
Output for 5.0.2
pid: 32709 running: 1 exitcode: -1 killing proc_open'ed process pid: 32709 running: 1 exitcode: -1
Output for 5.0.1
pid: 32712 running: 1 exitcode: -1 killing proc_open'ed process pid: 32712 running: 1 exitcode: -1
Output for 5.0.0
pid: 32714 running: 1 exitcode: -1 killing proc_open'ed process pid: 32714 running: 1 exitcode: -1
Output for 4.3.0 - 4.4.9
Warning: proc_open() expects exactly 3 parameters, 4 given in /in/pPlHg on line 20 proc_open failed for command /bin/bash -c "sleep 30"