3v4l.org

run code in 300+ PHP versions simultaneously
<?php $stringToSign = [ 'POST', 'application/json', 'Thu, 17 Jan 2019 02:45:06 GMT', '/ayden/init', 'qz0HpayQzMDnBfJMfUB5zJGU62nX2Uef66m6YIpDAWA=' ]; $string = implode("\n", $stringToSign) . "\n"; $hmac = base64_encode(hash_hmac('sha256', $string, 'secret', true)); echo $hmac;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/A2sTt
function name:  (null)
number of ops:  19
compiled vars:  !0 = $stringToSign, !1 = $string, !2 = $hmac
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   11     1        INIT_FCALL                                               'implode'
          2        SEND_VAL                                                 '%0A'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $4      
          5        CONCAT                                           ~5      $4, '%0A'
          6        ASSIGN                                                   !1, ~5
   12     7        INIT_FCALL                                               'base64_encode'
          8        INIT_FCALL                                               'hash_hmac'
          9        SEND_VAL                                                 'sha256'
         10        SEND_VAR                                                 !1
         11        SEND_VAL                                                 'secret'
         12        SEND_VAL                                                 <true>
         13        DO_ICALL                                         $7      
         14        SEND_VAR                                                 $7
         15        DO_ICALL                                         $8      
         16        ASSIGN                                                   !2, $8
   13    17        ECHO                                                     !2
   14    18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.51 ms | 999 KiB | 16 Q