3v4l.org

run code in 300+ PHP versions simultaneously
<?php if ($argc > 1) { var_dump($argv); } else { $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 ); $proc = proc_open("php " . escapeshellarg($argv[0]) . " args lel", $descriptorspec, $pipes); fclose($pipes[0]); // default-inherited-stdin creeps me out while (proc_get_status($proc)['running']) { usleep(100 * 1000); } var_dump('stdout: ', stream_get_contents($pipes[1])); fclose($pipes[1]); proc_close($proc); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 6
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 47
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 24
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 24
Branch analysis from position: 32
Branch analysis from position: 24
filename:       /in/4uC8n
function name:  (null)
number of ops:  48
compiled vars:  !0 = $argc, !1 = $argv, !2 = $descriptorspec, !3 = $proc, !4 = $pipes
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   IS_SMALLER                                               1, !0
          1      > JMPZ                                                     ~5, ->6
    3     2    >   INIT_FCALL                                               'var_dump'
          3        SEND_VAR                                                 !1
          4        DO_ICALL                                                 
          5      > JMP                                                      ->47
    5     6    >   ASSIGN                                                   !2, <array>
    9     7        INIT_FCALL                                               'proc_open'
          8        INIT_FCALL                                               'escapeshellarg'
          9        FETCH_DIM_R                                      ~8      !1, 0
         10        SEND_VAL                                                 ~8
         11        DO_ICALL                                         $9      
         12        CONCAT                                           ~10     'php+', $9
         13        CONCAT                                           ~11     ~10, '+args+lel'
         14        SEND_VAL                                                 ~11
         15        SEND_VAR                                                 !2
         16        SEND_REF                                                 !4
         17        DO_ICALL                                         $12     
         18        ASSIGN                                                   !3, $12
   10    19        INIT_FCALL                                               'fclose'
         20        FETCH_DIM_R                                      ~14     !4, 0
         21        SEND_VAL                                                 ~14
         22        DO_ICALL                                                 
   11    23      > JMP                                                      ->27
   12    24    >   INIT_FCALL                                               'usleep'
         25        SEND_VAL                                                 100000
         26        DO_ICALL                                                 
   11    27    >   INIT_FCALL                                               'proc_get_status'
         28        SEND_VAR                                                 !3
         29        DO_ICALL                                         $17     
         30        FETCH_DIM_R                                      ~18     $17, 'running'
         31      > JMPNZ                                                    ~18, ->24
   14    32    >   INIT_FCALL                                               'var_dump'
         33        SEND_VAL                                                 'stdout%3A+'
         34        INIT_FCALL                                               'stream_get_contents'
         35        FETCH_DIM_R                                      ~19     !4, 1
         36        SEND_VAL                                                 ~19
         37        DO_ICALL                                         $20     
         38        SEND_VAR                                                 $20
         39        DO_ICALL                                                 
   15    40        INIT_FCALL                                               'fclose'
         41        FETCH_DIM_R                                      ~22     !4, 1
         42        SEND_VAL                                                 ~22
         43        DO_ICALL                                                 
   16    44        INIT_FCALL                                               'proc_close'
         45        SEND_VAR                                                 !3
         46        DO_ICALL                                                 
   17    47    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
182.8 ms | 1400 KiB | 29 Q