3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
181.54 ms | 1400 KiB | 25 Q