3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.61 ms | 1392 KiB | 25 Q