3v4l.org

run code in 300+ PHP versions simultaneously
<?php $r = md5(rand().microtime(TRUE)); $_POST = [ $r => 'theSubmittedUsername', '__autocomplete_fix_' . $r => 'username' ]; foreach ($_POST as $key => $val) { $newKey = preg_replace('~^__autocomplete_fix_~', '', $key, 1, $count); if ($count) { $_POST[$val] = $_POST[$newKey]; unset($_POST[$key], $_POST[$newKey]); } } var_export($_POST);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 38
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 38
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 37
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 37
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 38
filename:       /in/kBJtN
function name:  (null)
number of ops:  44
compiled vars:  !0 = $r, !1 = $val, !2 = $key, !3 = $newKey, !4 = $count
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'md5'
          1        INIT_FCALL                                               'rand'
          2        DO_ICALL                                         $5      
          3        INIT_FCALL                                               'microtime'
          4        SEND_VAL                                                 <true>
          5        DO_ICALL                                         $6      
          6        CONCAT                                           ~7      $5, $6
          7        SEND_VAL                                                 ~7
          8        DO_ICALL                                         $8      
          9        ASSIGN                                                   !0, $8
    5    10        INIT_ARRAY                                       ~11     'theSubmittedUsername', !0
    6    11        CONCAT                                           ~12     '__autocomplete_fix_', !0
         12        ADD_ARRAY_ELEMENT                                ~11     'username', ~12
    4    13        FETCH_W                      global              $10     '_POST'
         14        ASSIGN                                                   $10, ~11
    9    15        FETCH_R                      global              ~14     '_POST'
         16      > FE_RESET_R                                       $15     ~14, ->38
         17    > > FE_FETCH_R                                       ~16     $15, !1, ->38
         18    >   ASSIGN                                                   !2, ~16
   10    19        INIT_FCALL                                               'preg_replace'
         20        SEND_VAL                                                 '%7E%5E__autocomplete_fix_%7E'
         21        SEND_VAL                                                 ''
         22        SEND_VAR                                                 !2
         23        SEND_VAL                                                 1
         24        SEND_REF                                                 !4
         25        DO_ICALL                                         $18     
         26        ASSIGN                                                   !3, $18
   11    27      > JMPZ                                                     !4, ->37
   12    28    >   FETCH_R                      global              ~22     '_POST'
         29        FETCH_DIM_R                                      ~23     ~22, !3
         30        FETCH_W                      global              $20     '_POST'
         31        ASSIGN_DIM                                               $20, !1
         32        OP_DATA                                                  ~23
   13    33        FETCH_UNSET                                      $24     '_POST'
         34        UNSET_DIM                                                $24, !2
         35        FETCH_UNSET                                      $25     '_POST'
         36        UNSET_DIM                                                $25, !3
    9    37    > > JMP                                                      ->17
         38    >   FE_FREE                                                  $15
   16    39        INIT_FCALL                                               'var_export'
         40        FETCH_R                      global              ~26     '_POST'
         41        SEND_VAL                                                 ~26
         42        DO_ICALL                                                 
         43      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.94 ms | 1400 KiB | 23 Q