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 = 62
Branch analysis from position: 62
2 jumps found. (Code = 44) Position 1 = 64, Position 2 = 7
Branch analysis from position: 64
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 57
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 38
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
2 jumps found. (Code = 43) Position 1 = 49, Position 2 = 55
Branch analysis from position: 49
1 jumps found. (Code = 42) Position 1 = 56
Branch analysis from position: 56
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 = 18
Branch analysis from position: 61
2 jumps found. (Code = 44) Position 1 = 64, Position 2 = 7
Branch analysis from position: 64
Branch analysis from position: 7
Branch analysis from position: 18
Branch analysis from position: 60
Branch analysis from position: 55
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: 38
2 jumps found. (Code = 43) Position 1 = 49, Position 2 = 55
Branch analysis from position: 49
Branch analysis from position: 55
Branch analysis from position: 57
filename:       /in/uijGW
function name:  (null)
number of ops:  78
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
-------------------------------------------------------------------------------------
    1     0  E >   ECHO                                                     '%2C'
    3     1        INIT_FCALL                                               'microtime'
          2        SEND_VAL                                                 <true>
          3        DO_ICALL                                         $7      
          4        ASSIGN                                                   !0, $7
    5     5        ASSIGN                                                   !1, 0
          6      > JMP                                                      ->62
    6     7    >   ASSIGN                                                   !2, <array>
    7     8        INIT_FCALL                                               'implode'
          9        SEND_VAL                                                 '%7C'
         10        INIT_FCALL                                               'array_keys'
         11        FETCH_R                      global              ~11     '_SERVER'
         12        SEND_VAL                                                 ~11
         13        DO_ICALL                                         $12     
         14        SEND_VAR                                                 $12
         15        DO_ICALL                                         $13     
         16        CONCAT                                           ~14     '%7C', $13
         17        ASSIGN                                                   !3, ~14
    9    18    >   INIT_FCALL                                               'strpos'
         19        SEND_VAR                                                 !3
         20        SEND_VAL                                                 '%7CSCRIPT_'
         21        DO_ICALL                                         $16     
         22        ASSIGN                                           ~17     !4, $16
         23        TYPE_CHECK                                  1018          ~17
         24      > JMPZ                                                     ~18, ->57
   10    25    >   INIT_FCALL                                               'strpos'
         26        SEND_VAR                                                 !3
         27        SEND_VAL                                                 '%7C'
         28        ADD                                              ~19     !4, 1
         29        SEND_VAL                                                 ~19
         30        DO_ICALL                                         $20     
         31        ASSIGN                                           ~21     !5, $20
         32        TYPE_CHECK                                  1018          ~21
         33      > JMPZ                                                     ~22, ->38
   11    34    >   SUB                                              ~23     !5, !4
         35        SUB                                              ~24     ~23, 1
         36        ASSIGN                                                   !6, ~24
         37      > JMP                                                      ->39
   14    38    >   ASSIGN                                                   !6, null
   16    39    >   INIT_FCALL                                               'substr'
         40        SEND_VAR                                                 !3
         41        ADD                                              ~28     !4, 1
         42        SEND_VAL                                                 ~28
         43        SEND_VAR                                                 !6
         44        DO_ICALL                                         $29     
         45        ASSIGN_DIM                                               !2
         46        OP_DATA                                                  $29
   17    47        TYPE_CHECK                                  1018          !5
         48      > JMPZ                                                     ~30, ->55
         49    >   INIT_FCALL                                               'substr'
         50        SEND_VAR                                                 !3
         51        SEND_VAR                                                 !5
         52        DO_ICALL                                         $31     
         53        QM_ASSIGN                                        ~32     $31
         54      > JMP                                                      ->56
         55    >   QM_ASSIGN                                        ~32     ''
         56    >   ASSIGN                                                   !3, ~32
   19    57    >   TYPE_CHECK                                  1018  ~34     !4
         58      > JMPZ_EX                                          ~34     ~34, ->60
         59    >   BOOL                                             ~34     !3
         60    > > JMPNZ                                                    ~34, ->18
    5    61    >   PRE_INC                                                  !1
         62    >   IS_SMALLER                                               !1, 10000
         63      > JMPNZ                                                    ~36, ->7
   22    64    >   INIT_FCALL                                               'var_dump'
         65        FETCH_R                      global              ~37     '_SERVER'
         66        SEND_VAL                                                 ~37
         67        FETCH_R                      global              ~38     '_SERVER'
         68        COUNT                                            ~39     ~38
         69        SEND_VAL                                                 ~39
         70        SEND_VAR                                                 !2
         71        INIT_FCALL                                               'microtime'
         72        SEND_VAL                                                 <true>
         73        DO_ICALL                                         $40     
         74        SUB                                              ~41     $40, !0
         75        SEND_VAL                                                 ~41
         76        DO_ICALL                                                 
         77      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.65 ms | 1404 KiB | 25 Q