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("pipe", "w") // stderr is a file to write to ); $process = proc_open('php', $descriptorspec, $pipes, getcwd(), $_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]); echo stream_get_contents($pipes[2]); fclose($pipes[1]); fclose($pipes[2]); // 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 = 14, Position 2 = 49
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 49
filename:       /in/GsRp0
function name:  (null)
number of ops:  50
compiled vars:  !0 = $descriptorspec, !1 = $process, !2 = $pipes, !3 = $return_value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1        INIT_FCALL                                               'proc_open'
          2        SEND_VAL                                                 'php'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !2
          5        INIT_FCALL                                               'getcwd'
          6        DO_ICALL                                         $5      
          7        SEND_VAR                                                 $5
          8        FETCH_R                      global              ~6      '_ENV'
          9        SEND_VAL                                                 ~6
         10        DO_ICALL                                         $7      
         11        ASSIGN                                                   !1, $7
   11    12        TYPE_CHECK                                  512          !1
         13      > JMPZ                                                     ~9, ->49
   17    14    >   INIT_FCALL                                               'fwrite'
         15        FETCH_DIM_R                                      ~10     !2, 0
         16        SEND_VAL                                                 ~10
         17        SEND_VAL                                                 '%3C%3Fphp+print_r%28%24_ENV%29%3B+%3F%3E'
         18        DO_ICALL                                                 
   18    19        INIT_FCALL                                               'fclose'
         20        FETCH_DIM_R                                      ~12     !2, 0
         21        SEND_VAL                                                 ~12
         22        DO_ICALL                                                 
   20    23        INIT_FCALL                                               'stream_get_contents'
         24        FETCH_DIM_R                                      ~14     !2, 1
         25        SEND_VAL                                                 ~14
         26        DO_ICALL                                         $15     
         27        ECHO                                                     $15
   21    28        INIT_FCALL                                               'stream_get_contents'
         29        FETCH_DIM_R                                      ~16     !2, 2
         30        SEND_VAL                                                 ~16
         31        DO_ICALL                                         $17     
         32        ECHO                                                     $17
   22    33        INIT_FCALL                                               'fclose'
         34        FETCH_DIM_R                                      ~18     !2, 1
         35        SEND_VAL                                                 ~18
         36        DO_ICALL                                                 
   23    37        INIT_FCALL                                               'fclose'
         38        FETCH_DIM_R                                      ~20     !2, 2
         39        SEND_VAL                                                 ~20
         40        DO_ICALL                                                 
   27    41        INIT_FCALL                                               'proc_close'
         42        SEND_VAR                                                 !1
         43        DO_ICALL                                         $22     
         44        ASSIGN                                                   !3, $22
   29    45        ROPE_INIT                                     3  ~25     'command+returned+'
         46        ROPE_ADD                                      1  ~25     ~25, !3
         47        ROPE_END                                      2  ~24     ~25, '%0A'
         48        ECHO                                                     ~24
   31    49    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.22 ms | 1400 KiB | 25 Q