3v4l.org

run code in 300+ PHP versions simultaneously
<?php $descriptorspec = array( 0 => array("pipe", "r"), // stdin is a pipe that the child will read from 1 => array("pipe", "w"), // stdout is a pipe that the child will write to 2 => array("file", "error-output.txt", "a") // stderr is a file to write to ); $cwd = '/tmp'; $env = array('some_option' => 'aeiou'); $process = proc_open('php', $descriptorspec, $pipes, $cwd, $env); if (is_resource($process)) { // $pipes now looks like this: // 0 => writeable handle connected to child stdin // 1 => readable handle connected to child stdout // Any error output will be appended to /tmp/error-output.txt fwrite($pipes[0], '<?php print_r($_ENV); ?>'); fclose($pipes[0]); echo stream_get_contents($pipes[1]); fclose($pipes[1]); // It is important that you close any pipes before calling // proc_close in order to avoid a deadlock $return_value = proc_close($process); echo "command returned $return_value\n"; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 39
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 39
filename:       /in/KidJf
function name:  (null)
number of ops:  40
compiled vars:  !0 = $descriptorspec, !1 = $cwd, !2 = $env, !3 = $process, !4 = $pipes, !5 = $return_value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    8     1        ASSIGN                                                   !1, '%2Ftmp'
    9     2        ASSIGN                                                   !2, <array>
   11     3        INIT_FCALL                                               'proc_open'
          4        SEND_VAL                                                 'php'
          5        SEND_VAR                                                 !0
          6        SEND_REF                                                 !4
          7        SEND_VAR                                                 !1
          8        SEND_VAR                                                 !2
          9        DO_ICALL                                         $9      
         10        ASSIGN                                                   !3, $9
   13    11        TYPE_CHECK                                  512          !3
         12      > JMPZ                                                     ~11, ->39
   19    13    >   INIT_FCALL                                               'fwrite'
         14        FETCH_DIM_R                                      ~12     !4, 0
         15        SEND_VAL                                                 ~12
         16        SEND_VAL                                                 '%3C%3Fphp+print_r%28%24_ENV%29%3B+%3F%3E'
         17        DO_ICALL                                                 
   20    18        INIT_FCALL                                               'fclose'
         19        FETCH_DIM_R                                      ~14     !4, 0
         20        SEND_VAL                                                 ~14
         21        DO_ICALL                                                 
   22    22        INIT_FCALL                                               'stream_get_contents'
         23        FETCH_DIM_R                                      ~16     !4, 1
         24        SEND_VAL                                                 ~16
         25        DO_ICALL                                         $17     
         26        ECHO                                                     $17
   23    27        INIT_FCALL                                               'fclose'
         28        FETCH_DIM_R                                      ~18     !4, 1
         29        SEND_VAL                                                 ~18
         30        DO_ICALL                                                 
   27    31        INIT_FCALL                                               'proc_close'
         32        SEND_VAR                                                 !3
         33        DO_ICALL                                         $20     
         34        ASSIGN                                                   !5, $20
   29    35        ROPE_INIT                                     3  ~23     'command+returned+'
         36        ROPE_ADD                                      1  ~23     ~23, !5
         37        ROPE_END                                      2  ~22     ~23, '%0A'
         38        ECHO                                                     ~22
   31    39    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.65 ms | 1396 KiB | 23 Q