3v4l.org

run code in 300+ PHP versions simultaneously
<?php $X = array ( 'ALLUSERSPROFILE' => '', 'APPDATA' => '', 'COMMANDER_DRIVE' => '', 'COMMANDER_EXE' => '', 'COMMANDER_INI' => '', 'COMMANDER_PATH' => '', 'CommonProgramFiles' => '', 'CommonProgramFiles(x86)' => '', 'CommonProgramW6432' => '', 'COMPUTERNAME' => '', 'ComSpec' => '', 'EMAIL' => '', 'FP_NO_HOST_CHECK' => '', 'HOMEDRIVE' => '', 'HOMEPATH' => '', 'LOCALAPPDATA' => '', 'LOGONSERVER' => '', 'NUMBER_OF_PROCESSORS' => '', 'OS' => '', 'Path' => '', 'PATHEXT' => '', 'PROCESSOR_ARCHITECTURE' => '', 'PROCESSOR_ARCHITEW6432' => '', 'PROCESSOR_IDENTIFIER' => '', 'PROCESSOR_LEVEL' => '', 'PROCESSOR_REVISION' => '', 'ProgramData' => '', 'ProgramFiles' => '', 'ProgramFiles(x86)' => '', 'ProgramW6432' => '', 'PROMPT' => '', 'PSModulePath' => '', 'PUBLIC' => '', 'SESSIONNAME' => '', 'SystemDrive' => '', 'SystemRoot' => '', 'TEMP' => '', 'TMP' => '', 'USERDOMAIN' => '', 'USERDOMAIN_ROAMINGPROFILE' => '', 'USERNAME' => '', 'USERPROFILE' => '', 'VBOX_INSTALL_PATH' => '', 'VBOX_MSI_INSTALL_PATH' => '', 'windir' => '', 'HTTP_COOKIE' => '', 'HTTP_ACCEPT_LANGUAGE' => '', 'HTTP_ACCEPT_ENCODING' => '', 'HTTP_REFERER' => '', 'HTTP_USER_AGENT' => '', 'HTTP_ACCEPT' => '', 'HTTP_CACHE_CONTROL' => '', 'HTTP_CONNECTION' => '', 'HTTP_HOST' => '', 'SCRIPT_FILENAME' => '', 'REDIRECT_STATUS' => '', 'SERVER_NAME' => '', 'SERVER_PORT' => '', 'SERVER_ADDR' => '', 'REMOTE_PORT' => '', 'REMOTE_ADDR' => '', 'SERVER_SOFTWARE' => '', 'GATEWAY_INTERFACE' => '', 'SERVER_PROTOCOL' => '', 'DOCUMENT_ROOT' => '', 'DOCUMENT_URI' => '', 'REQUEST_URI' => '', 'SCRIPT_NAME' => '', 'CONTENT_LENGTH' => '', 'CONTENT_TYPE' => '', 'REQUEST_METHOD' => '', 'QUERY_STRING' => '', 'FCGI_ROLE' => '', 'PHP_SELF' => '', 'REQUEST_TIME_FLOAT' => '', 'REQUEST_TIME' => '', ); $time = microtime(true); for ($i = 0; $i < 10000; $i++) { $array = []; $str = '|' . implode('|', array_keys($X)); do { if (false !== $pos = strpos($str, '|HTTP_')) { 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($X, count($X), $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 = 7
Branch analysis from position: 63
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
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 = 7
Branch analysis from position: 63
Branch analysis from position: 7
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/sPqde
function name:  (null)
number of ops:  75
compiled vars:  !0 = $X, !1 = $time, !2 = $i, !3 = $array, !4 = $str, !5 = $pos, !6 = $pos2, !7 = $len
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   82     1        INIT_FCALL                                               'microtime'
          2        SEND_VAL                                                 <true>
          3        DO_ICALL                                         $9      
          4        ASSIGN                                                   !1, $9
   84     5        ASSIGN                                                   !2, 0
          6      > JMP                                                      ->61
   85     7    >   ASSIGN                                                   !3, <array>
   86     8        INIT_FCALL                                               'implode'
          9        SEND_VAL                                                 '%7C'
         10        INIT_FCALL                                               'array_keys'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $13     
         13        SEND_VAR                                                 $13
         14        DO_ICALL                                         $14     
         15        CONCAT                                           ~15     '%7C', $14
         16        ASSIGN                                                   !4, ~15
   88    17    >   INIT_FCALL                                               'strpos'
         18        SEND_VAR                                                 !4
         19        SEND_VAL                                                 '%7CHTTP_'
         20        DO_ICALL                                         $17     
         21        ASSIGN                                           ~18     !5, $17
         22        TYPE_CHECK                                  1018          ~18
         23      > JMPZ                                                     ~19, ->56
   89    24    >   INIT_FCALL                                               'strpos'
         25        SEND_VAR                                                 !4
         26        SEND_VAL                                                 '%7C'
         27        ADD                                              ~20     !5, 1
         28        SEND_VAL                                                 ~20
         29        DO_ICALL                                         $21     
         30        ASSIGN                                           ~22     !6, $21
         31        TYPE_CHECK                                  1018          ~22
         32      > JMPZ                                                     ~23, ->37
   90    33    >   SUB                                              ~24     !6, !5
         34        SUB                                              ~25     ~24, 1
         35        ASSIGN                                                   !7, ~25
         36      > JMP                                                      ->38
   93    37    >   ASSIGN                                                   !7, null
   95    38    >   INIT_FCALL                                               'substr'
         39        SEND_VAR                                                 !4
         40        ADD                                              ~29     !5, 1
         41        SEND_VAL                                                 ~29
         42        SEND_VAR                                                 !7
         43        DO_ICALL                                         $30     
         44        ASSIGN_DIM                                               !3
         45        OP_DATA                                                  $30
   96    46        TYPE_CHECK                                  1018          !6
         47      > JMPZ                                                     ~31, ->54
         48    >   INIT_FCALL                                               'substr'
         49        SEND_VAR                                                 !4
         50        SEND_VAR                                                 !6
         51        DO_ICALL                                         $32     
         52        QM_ASSIGN                                        ~33     $32
         53      > JMP                                                      ->55
         54    >   QM_ASSIGN                                        ~33     ''
         55    >   ASSIGN                                                   !4, ~33
   98    56    >   TYPE_CHECK                                  1018  ~35     !5
         57      > JMPZ_EX                                          ~35     ~35, ->59
         58    >   BOOL                                             ~35     !4
         59    > > JMPNZ                                                    ~35, ->17
   84    60    >   PRE_INC                                                  !2
         61    >   IS_SMALLER                                               !2, 10000
         62      > JMPNZ                                                    ~37, ->7
  101    63    >   INIT_FCALL                                               'var_dump'
         64        SEND_VAR                                                 !0
         65        COUNT                                            ~38     !0
         66        SEND_VAL                                                 ~38
         67        SEND_VAR                                                 !3
         68        INIT_FCALL                                               'microtime'
         69        SEND_VAL                                                 <true>
         70        DO_ICALL                                         $39     
         71        SUB                                              ~40     $39, !1
         72        SEND_VAL                                                 ~40
         73        DO_ICALL                                                 
         74      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.83 ms | 1400 KiB | 25 Q