3v4l.org

run code in 300+ PHP versions simultaneously
<?php $time = microtime(true); for ($i = 0; $i < 10000; $i++) { $array = array(); $str = '|' . implode('|', array_keys($_SERVER)); do { if (false !== $pos = strpos($str, '|SCRIPT_')) { if (false !== $pos2 = strpos($str, '|', $pos + 1)) { $array[] = substr($str, $pos + 1, $pos2 - $pos - 1); $str = substr($str, $pos2); } else { $array[] = substr($str, $pos + 1); $str = ''; } } } while ($pos !== false && $str); } var_dump($array, microtime(true) - $time);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 62
Branch analysis from position: 62
2 jumps found. (Code = 44) Position 1 = 64, Position 2 = 6
Branch analysis from position: 64
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 57
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 49
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 57
Branch analysis from position: 57
2 jumps found. (Code = 46) Position 1 = 59, Position 2 = 60
Branch analysis from position: 59
2 jumps found. (Code = 44) Position 1 = 61, Position 2 = 17
Branch analysis from position: 61
2 jumps found. (Code = 44) Position 1 = 64, Position 2 = 6
Branch analysis from position: 64
Branch analysis from position: 6
Branch analysis from position: 17
Branch analysis from position: 60
Branch analysis from position: 49
2 jumps found. (Code = 46) Position 1 = 59, Position 2 = 60
Branch analysis from position: 59
Branch analysis from position: 60
Branch analysis from position: 57
filename:       /in/HHspO
function name:  (null)
number of ops:  73
compiled vars:  !0 = $time, !1 = $i, !2 = $array, !3 = $str, !4 = $pos, !5 = $pos2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $6      
          3        ASSIGN                                                   !0, $6
    5     4        ASSIGN                                                   !1, 0
          5      > JMP                                                      ->62
    6     6    >   ASSIGN                                                   !2, <array>
    7     7        INIT_FCALL                                               'implode'
          8        SEND_VAL                                                 '%7C'
          9        INIT_FCALL                                               'array_keys'
         10        FETCH_R                      global              ~10     '_SERVER'
         11        SEND_VAL                                                 ~10
         12        DO_ICALL                                         $11     
         13        SEND_VAR                                                 $11
         14        DO_ICALL                                         $12     
         15        CONCAT                                           ~13     '%7C', $12
         16        ASSIGN                                                   !3, ~13
    9    17    >   INIT_FCALL                                               'strpos'
         18        SEND_VAR                                                 !3
         19        SEND_VAL                                                 '%7CSCRIPT_'
         20        DO_ICALL                                         $15     
         21        ASSIGN                                           ~16     !4, $15
         22        TYPE_CHECK                                  1018          ~16
         23      > JMPZ                                                     ~17, ->57
   10    24    >   INIT_FCALL                                               'strpos'
         25        SEND_VAR                                                 !3
         26        SEND_VAL                                                 '%7C'
         27        ADD                                              ~18     !4, 1
         28        SEND_VAL                                                 ~18
         29        DO_ICALL                                         $19     
         30        ASSIGN                                           ~20     !5, $19
         31        TYPE_CHECK                                  1018          ~20
         32      > JMPZ                                                     ~21, ->49
   11    33    >   INIT_FCALL                                               'substr'
         34        SEND_VAR                                                 !3
         35        ADD                                              ~23     !4, 1
         36        SEND_VAL                                                 ~23
         37        SUB                                              ~24     !5, !4
         38        SUB                                              ~25     ~24, 1
         39        SEND_VAL                                                 ~25
         40        DO_ICALL                                         $26     
         41        ASSIGN_DIM                                               !2
         42        OP_DATA                                                  $26
   12    43        INIT_FCALL                                               'substr'
         44        SEND_VAR                                                 !3
         45        SEND_VAR                                                 !5
         46        DO_ICALL                                         $27     
         47        ASSIGN                                                   !3, $27
         48      > JMP                                                      ->57
   15    49    >   INIT_FCALL                                               'substr'
         50        SEND_VAR                                                 !3
         51        ADD                                              ~30     !4, 1
         52        SEND_VAL                                                 ~30
         53        DO_ICALL                                         $31     
         54        ASSIGN_DIM                                               !2
         55        OP_DATA                                                  $31
   16    56        ASSIGN                                                   !3, ''
   19    57    >   TYPE_CHECK                                  1018  ~33     !4
         58      > JMPZ_EX                                          ~33     ~33, ->60
         59    >   BOOL                                             ~33     !3
         60    > > JMPNZ                                                    ~33, ->17
    5    61    >   PRE_INC                                                  !1
         62    >   IS_SMALLER                                               !1, 10000
         63      > JMPNZ                                                    ~35, ->6
   22    64    >   INIT_FCALL                                               'var_dump'
         65        SEND_VAR                                                 !2
         66        INIT_FCALL                                               'microtime'
         67        SEND_VAL                                                 <true>
         68        DO_ICALL                                         $36     
         69        SUB                                              ~37     $36, !0
         70        SEND_VAL                                                 ~37
         71        DO_ICALL                                                 
         72      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.46 ms | 1400 KiB | 25 Q