3v4l.org

run code in 300+ PHP versions simultaneously
<?php function deriveSP800108HmacSHA256Key($length, $array, $string, $array2) { $n = $n2 = 1; $allocate = ''; // length = $length while ($n < $length) { $mac = hash_init('sha256', HASH_HMAC, $array); $allocate2 = pack("L", $n2); hash_update($mac, $allocate2); hash_update($mac, $string); hash_update($mac, pack("L", 0)); hash_update($mac, $array2); $allocate2 = pack("L", $n * 8); hash_update($mac, $allocate2); $final = hash_final($mac, true); $allocate .= $final; $n2++; } return unpack('C*', $allocate); } var_dump(deriveSP800108HmacSHA256Key(32, 'array', 'foo', 'array2'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GMnbh
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'derivesp800108hmacsha256key'
          2        SEND_VAL                                                 32
          3        SEND_VAL                                                 'array'
          4        SEND_VAL                                                 'foo'
          5        SEND_VAL                                                 'array2'
          6        DO_FCALL                                      0  $0      
          7        SEND_VAR                                                 $0
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function derivesp800108hmacsha256key:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 56
Branch analysis from position: 56
2 jumps found. (Code = 44) Position 1 = 58, Position 2 = 8
Branch analysis from position: 58
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 58, Position 2 = 8
Branch analysis from position: 58
Branch analysis from position: 8
filename:       /in/GMnbh
function name:  deriveSP800108HmacSHA256Key
number of ops:  64
compiled vars:  !0 = $length, !1 = $array, !2 = $string, !3 = $array2, !4 = $n, !5 = $n2, !6 = $allocate, !7 = $mac, !8 = $allocate2, !9 = $final
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
    4     4        ASSIGN                                           ~10     !5, 1
          5        ASSIGN                                                   !4, ~10
    5     6        ASSIGN                                                   !6, ''
    7     7      > JMP                                                      ->56
    8     8    >   INIT_FCALL                                               'hash_init'
          9        SEND_VAL                                                 'sha256'
         10        SEND_VAL                                                 1
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $13     
         13        ASSIGN                                                   !7, $13
    9    14        INIT_FCALL                                               'pack'
         15        SEND_VAL                                                 'L'
         16        SEND_VAR                                                 !5
         17        DO_ICALL                                         $15     
         18        ASSIGN                                                   !8, $15
   11    19        INIT_FCALL                                               'hash_update'
         20        SEND_VAR                                                 !7
         21        SEND_VAR                                                 !8
         22        DO_ICALL                                                 
   12    23        INIT_FCALL                                               'hash_update'
         24        SEND_VAR                                                 !7
         25        SEND_VAR                                                 !2
         26        DO_ICALL                                                 
   13    27        INIT_FCALL                                               'hash_update'
         28        SEND_VAR                                                 !7
         29        INIT_FCALL                                               'pack'
         30        SEND_VAL                                                 'L'
         31        SEND_VAL                                                 0
         32        DO_ICALL                                         $19     
         33        SEND_VAR                                                 $19
         34        DO_ICALL                                                 
   14    35        INIT_FCALL                                               'hash_update'
         36        SEND_VAR                                                 !7
         37        SEND_VAR                                                 !3
         38        DO_ICALL                                                 
   16    39        INIT_FCALL                                               'pack'
         40        SEND_VAL                                                 'L'
         41        MUL                                              ~22     !4, 8
         42        SEND_VAL                                                 ~22
         43        DO_ICALL                                         $23     
         44        ASSIGN                                                   !8, $23
   17    45        INIT_FCALL                                               'hash_update'
         46        SEND_VAR                                                 !7
         47        SEND_VAR                                                 !8
         48        DO_ICALL                                                 
   19    49        INIT_FCALL                                               'hash_final'
         50        SEND_VAR                                                 !7
         51        SEND_VAL                                                 <true>
         52        DO_ICALL                                         $26     
         53        ASSIGN                                                   !9, $26
   20    54        ASSIGN_OP                                     8          !6, !9
   22    55        PRE_INC                                                  !5
    7    56    >   IS_SMALLER                                               !4, !0
         57      > JMPNZ                                                    ~30, ->8
   25    58    >   INIT_FCALL                                               'unpack'
         59        SEND_VAL                                                 'C%2A'
         60        SEND_VAR                                                 !6
         61        DO_ICALL                                         $31     
         62      > RETURN                                                   $31
   26    63*     > RETURN                                                   null

End of function derivesp800108hmacsha256key

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.27 ms | 1402 KiB | 26 Q