3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(-1); $command = '/bin/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); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 47
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 51
Branch analysis from position: 51
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FcY3d
function name:  (null)
number of ops:  52
compiled vars:  !0 = $command, !1 = $pipes, !2 = $error, !3 = $output, !4 = $process, !5 = $status
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 -1
          2        DO_ICALL                                                 
    5     3        ASSIGN                                                   !0, '%2Fbin%2Fsleep+30'
    7     4        ASSIGN                                                   !1, <array>
    8     5        ASSIGN                                           ~9      !3, ''
          6        ASSIGN                                                   !2, ~9
   10     7        INIT_FCALL                                               'proc_open'
   11     8        SEND_VAR                                                 !0
   13     9        SEND_VAL                                                 <array>
   17    10        SEND_REF                                                 !1
         11        DO_ICALL                                         $11     
   10    12        ASSIGN                                                   !4, $11
   19    13        INIT_FCALL                                               'usleep'
         14        SEND_VAL                                                 1000
         15        DO_ICALL                                                 
   20    16        TYPE_CHECK                                  512          !4
         17      > JMPZ                                                     ~14, ->47
   21    18    >   INIT_FCALL                                               'proc_get_status'
         19        SEND_VAR                                                 !4
         20        DO_ICALL                                         $15     
         21        ASSIGN                                                   !5, $15
   22    22        INIT_FCALL                                               'printf'
         23        SEND_VAL                                                 'running%3A+%25d+exitcode%3A+%25d%0A'
         24        FETCH_DIM_R                                      ~17     !5, 'running'
         25        SEND_VAL                                                 ~17
         26        FETCH_DIM_R                                      ~18     !5, 'exitcode'
         27        SEND_VAL                                                 ~18
         28        DO_ICALL                                                 
   23    29        ECHO                                                     'killing+proc_open%27ed+process%0A'
   24    30        INIT_FCALL                                               'posix_kill'
         31        FETCH_DIM_R                                      ~20     !5, 'pid'
         32        SEND_VAL                                                 ~20
         33        SEND_VAL                                                 9
         34        DO_ICALL                                                 
   25    35        INIT_FCALL                                               'proc_get_status'
         36        SEND_VAR                                                 !4
         37        DO_ICALL                                         $22     
         38        ASSIGN                                                   !5, $22
   26    39        INIT_FCALL                                               'printf'
         40        SEND_VAL                                                 'running%3A+%25d+exitcode%3A+%25d%0A'
         41        FETCH_DIM_R                                      ~24     !5, 'running'
         42        SEND_VAL                                                 ~24
         43        FETCH_DIM_R                                      ~25     !5, 'exitcode'
         44        SEND_VAL                                                 ~25
         45        DO_ICALL                                                 
         46      > JMP                                                      ->51
   28    47    >   INIT_FCALL                                               'printf'
         48        SEND_VAL                                                 'proc_open+failed+for+command+%25s%0A'
         49        SEND_VAR                                                 !0
         50        DO_ICALL                                                 
   29    51    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
227.44 ms | 1400 KiB | 25 Q