3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Spoke $key = 'This is the key'; $secret = "TRUSTNO1"; $request = array( 'license' => $key, 'authentication' => hash_hmac('sha256', $key, $secret), ); ?> <?php // Hub $key_index = array( 'This is the key' => 'TRUSTNO1' ); if ($auth = $request['authentication']) { if ($key = $request['license'] && $secret = $key_index[$key]) { $new_hash = hash_hmac('sha256', $key, $secret); if (hash_compare($new_hash, $auth)) { var_dump('Authenticated.'); } else { var_dump('Not authenticated'); } } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 40
Branch analysis from position: 15
2 jumps found. (Code = 46) Position 1 = 17, Position 2 = 20
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 40
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 37
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 40
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 40
Branch analysis from position: 20
Branch analysis from position: 40
filename:       /in/828rg
function name:  (null)
number of ops:  41
compiled vars:  !0 = $key, !1 = $secret, !2 = $request, !3 = $key_index, !4 = $auth, !5 = $new_hash
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 'This+is+the+key'
    5     1        ASSIGN                                                   !1, 'TRUSTNO1'
    8     2        INIT_ARRAY                                       ~8      !0, 'license'
    9     3        INIT_FCALL                                               'hash_hmac'
          4        SEND_VAL                                                 'sha256'
          5        SEND_VAR                                                 !0
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $9      
          8        ADD_ARRAY_ELEMENT                                ~8      $9, 'authentication'
    7     9        ASSIGN                                                   !2, ~8
   12    10        ECHO                                                     '%0A%0A%0A'
   17    11        ASSIGN                                                   !3, <array>
   21    12        FETCH_DIM_R                                      ~12     !2, 'authentication'
         13        ASSIGN                                           ~13     !4, ~12
         14      > JMPZ                                                     ~13, ->40
   23    15    >   FETCH_DIM_R                                      ~14     !2, 'license'
         16      > JMPZ_EX                                          ~14     ~14, ->20
         17    >   FETCH_DIM_R                                      ~15     !3, !0
         18        ASSIGN                                           ~16     !1, ~15
         19        BOOL                                             ~14     ~16
         20    >   ASSIGN                                           ~17     !0, ~14
         21      > JMPZ                                                     ~17, ->40
   24    22    >   INIT_FCALL                                               'hash_hmac'
         23        SEND_VAL                                                 'sha256'
         24        SEND_VAR                                                 !0
         25        SEND_VAR                                                 !1
         26        DO_ICALL                                         $18     
         27        ASSIGN                                                   !5, $18
   25    28        INIT_FCALL_BY_NAME                                       'hash_compare'
         29        SEND_VAR_EX                                              !5
         30        SEND_VAR_EX                                              !4
         31        DO_FCALL                                      0  $20     
         32      > JMPZ                                                     $20, ->37
   26    33    >   INIT_FCALL                                               'var_dump'
         34        SEND_VAL                                                 'Authenticated.'
         35        DO_ICALL                                                 
         36      > JMP                                                      ->40
   28    37    >   INIT_FCALL                                               'var_dump'
         38        SEND_VAL                                                 'Not+authenticated'
         39        DO_ICALL                                                 
   31    40    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.11 ms | 1400 KiB | 17 Q