3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL); $cmd = 'php -r "fwrite(STDOUT, $in = file_get_contents(\'php://stdin\')); fwrite(STDERR, $in);"'; $descriptors = array(array('pipe', 'r'), array('pipe', 'w'), array('pipe', 'w')); $stdin = str_repeat('*', 4097); $options = array_merge(array('suppress_errors' => true, 'binary_pipes' => true, 'bypass_shell' => false)); $process = proc_open($cmd, $descriptors, $pipes, getcwd(), array(), $options); foreach ($pipes as $pipe) { stream_set_blocking($pipe, false); } $writePipes = array($pipes[0]); $stdinLen = strlen($stdin); $stdinOffset = 0; unset($pipes[0]); while ($pipes || $writePipes) { $r = $pipes; $w = $writePipes; $e = null; $n = stream_select($r, $w, $e, 60); if (false === $n) { break; } elseif ($n === 0) { proc_terminate($process); } if ($w) { $written = fwrite($writePipes[0], (binary)substr($stdin, $stdinOffset), 8192); if (false !== $written) { $stdinOffset += $written; } if ($stdinOffset >= $stdinLen) { fclose($writePipes[0]); $writePipes = null; } } foreach ($r as $pipe) { $type = array_search($pipe, $pipes); $data = fread($pipe, 8192); if (false === $data || feof($pipe)) { fclose($pipe); unset($pipes[$type]); } } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 26, Position 2 = 32
Branch analysis from position: 26
2 jumps found. (Code = 78) Position 1 = 27, Position 2 = 32
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 108
Branch analysis from position: 108
2 jumps found. (Code = 47) Position 1 = 109, Position 2 = 110
Branch analysis from position: 109
2 jumps found. (Code = 44) Position 1 = 111, Position 2 = 41
Branch analysis from position: 111
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 41
2 jumps found. (Code = 43) Position 1 = 53, Position 2 = 55
Branch analysis from position: 53
1 jumps found. (Code = 42) Position 1 = 111
Branch analysis from position: 111
Branch analysis from position: 55
2 jumps found. (Code = 43) Position 1 = 57, Position 2 = 60
Branch analysis from position: 57
2 jumps found. (Code = 43) Position 1 = 61, Position 2 = 83
Branch analysis from position: 61
2 jumps found. (Code = 43) Position 1 = 75, Position 2 = 76
Branch analysis from position: 75
2 jumps found. (Code = 43) Position 1 = 78, Position 2 = 83
Branch analysis from position: 78
2 jumps found. (Code = 77) Position 1 = 84, Position 2 = 107
Branch analysis from position: 84
2 jumps found. (Code = 78) Position 1 = 85, Position 2 = 107
Branch analysis from position: 85
2 jumps found. (Code = 47) Position 1 = 97, Position 2 = 101
Branch analysis from position: 97
2 jumps found. (Code = 43) Position 1 = 102, Position 2 = 106
Branch analysis from position: 102
1 jumps found. (Code = 42) Position 1 = 84
Branch analysis from position: 84
Branch analysis from position: 106
Branch analysis from position: 101
Branch analysis from position: 107
2 jumps found. (Code = 47) Position 1 = 109, Position 2 = 110
Branch analysis from position: 109
Branch analysis from position: 110
Branch analysis from position: 107
Branch analysis from position: 83
Branch analysis from position: 76
Branch analysis from position: 83
Branch analysis from position: 60
Branch analysis from position: 110
Branch analysis from position: 32
filename:       /in/hKfZj
function name:  (null)
number of ops:  112
compiled vars:  !0 = $cmd, !1 = $descriptors, !2 = $stdin, !3 = $options, !4 = $process, !5 = $pipes, !6 = $pipe, !7 = $writePipes, !8 = $stdinLen, !9 = $stdinOffset, !10 = $r, !11 = $w, !12 = $e, !13 = $n, !14 = $written, !15 = $type, !16 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 32767
          2        DO_ICALL                                                 
    5     3        ASSIGN                                                   !0, 'php+-r+%22fwrite%28STDOUT%2C+%24in+%3D+file_get_contents%28%27php%3A%2F%2Fstdin%27%29%29%3B+fwrite%28STDERR%2C+%24in%29%3B%22'
    6     4        ASSIGN                                                   !1, <array>
    7     5        INIT_FCALL                                               'str_repeat'
          6        SEND_VAL                                                 '%2A'
          7        SEND_VAL                                                 4097
          8        DO_ICALL                                         $20     
          9        ASSIGN                                                   !2, $20
    9    10        INIT_FCALL                                               'array_merge'
         11        SEND_VAL                                                 <array>
         12        DO_ICALL                                         $22     
         13        ASSIGN                                                   !3, $22
   10    14        INIT_FCALL                                               'proc_open'
         15        SEND_VAR                                                 !0
         16        SEND_VAR                                                 !1
         17        SEND_REF                                                 !5
         18        INIT_FCALL                                               'getcwd'
         19        DO_ICALL                                         $24     
         20        SEND_VAR                                                 $24
         21        SEND_VAL                                                 <array>
         22        SEND_VAR                                                 !3
         23        DO_ICALL                                         $25     
         24        ASSIGN                                                   !4, $25
   12    25      > FE_RESET_R                                       $27     !5, ->32
         26    > > FE_FETCH_R                                               $27, !6, ->32
   13    27    >   INIT_FCALL                                               'stream_set_blocking'
         28        SEND_VAR                                                 !6
         29        SEND_VAL                                                 <false>
         30        DO_ICALL                                                 
   12    31      > JMP                                                      ->26
         32    >   FE_FREE                                                  $27
   15    33        FETCH_DIM_R                                      ~29     !5, 0
         34        INIT_ARRAY                                       ~30     ~29
         35        ASSIGN                                                   !7, ~30
   16    36        STRLEN                                           ~32     !2
         37        ASSIGN                                                   !8, ~32
   17    38        ASSIGN                                                   !9, 0
   19    39        UNSET_DIM                                                !5, 0
   21    40      > JMP                                                      ->108
   22    41    >   ASSIGN                                                   !10, !5
   23    42        ASSIGN                                                   !11, !7
   24    43        ASSIGN                                                   !12, null
   25    44        INIT_FCALL                                               'stream_select'
         45        SEND_REF                                                 !10
         46        SEND_REF                                                 !11
         47        SEND_REF                                                 !12
         48        SEND_VAL                                                 60
         49        DO_ICALL                                         $38     
         50        ASSIGN                                                   !13, $38
   27    51        TYPE_CHECK                                    4          !13
         52      > JMPZ                                                     ~40, ->55
   28    53    > > JMP                                                      ->111
         54*       JMP                                                      ->60
   29    55    >   IS_IDENTICAL                                             !13, 0
         56      > JMPZ                                                     ~41, ->60
   30    57    >   INIT_FCALL                                               'proc_terminate'
         58        SEND_VAR                                                 !4
         59        DO_ICALL                                                 
   33    60    > > JMPZ                                                     !11, ->83
   34    61    >   INIT_FCALL                                               'fwrite'
         62        FETCH_DIM_R                                      ~43     !7, 0
         63        SEND_VAL                                                 ~43
         64        INIT_FCALL                                               'substr'
         65        SEND_VAR                                                 !2
         66        SEND_VAR                                                 !9
         67        DO_ICALL                                         $44     
         68        CAST                                          6  ~45     $44
         69        SEND_VAL                                                 ~45
         70        SEND_VAL                                                 8192
         71        DO_ICALL                                         $46     
         72        ASSIGN                                                   !14, $46
   35    73        TYPE_CHECK                                  1018          !14
         74      > JMPZ                                                     ~48, ->76
   36    75    >   ASSIGN_OP                                     1          !9, !14
   38    76    >   IS_SMALLER_OR_EQUAL                                      !8, !9
         77      > JMPZ                                                     ~50, ->83
   39    78    >   INIT_FCALL                                               'fclose'
         79        FETCH_DIM_R                                      ~51     !7, 0
         80        SEND_VAL                                                 ~51
         81        DO_ICALL                                                 
   40    82        ASSIGN                                                   !7, null
   44    83    > > FE_RESET_R                                       $54     !10, ->107
         84    > > FE_FETCH_R                                               $54, !6, ->107
   45    85    >   INIT_FCALL                                               'array_search'
         86        SEND_VAR                                                 !6
         87        SEND_VAR                                                 !5
         88        DO_ICALL                                         $55     
         89        ASSIGN                                                   !15, $55
   46    90        INIT_FCALL                                               'fread'
         91        SEND_VAR                                                 !6
         92        SEND_VAL                                                 8192
         93        DO_ICALL                                         $57     
         94        ASSIGN                                                   !16, $57
   47    95        TYPE_CHECK                                    4  ~59     !16
         96      > JMPNZ_EX                                         ~59     ~59, ->101
         97    >   INIT_FCALL                                               'feof'
         98        SEND_VAR                                                 !6
         99        DO_ICALL                                         $60     
        100        BOOL                                             ~59     $60
        101    > > JMPZ                                                     ~59, ->106
   48   102    >   INIT_FCALL                                               'fclose'
        103        SEND_VAR                                                 !6
        104        DO_ICALL                                                 
   49   105        UNSET_DIM                                                !5, !15
   44   106    > > JMP                                                      ->84
        107    >   FE_FREE                                                  $54
   21   108    > > JMPNZ_EX                                         ~62     !5, ->110
        109    >   BOOL                                             ~62     !7
        110    > > JMPNZ                                                    ~62, ->41
   52   111    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.26 ms | 1396 KiB | 41 Q