3v4l.org

run code in 300+ PHP versions simultaneously
<?php $post_parameters = array('type' => 'buy', 'amount' => 5.3); $concatted_post_parameters = ''; $http_method = 'METHOD'; $uri = 'API'; $api_key = '789'; $nonce = 555; $secret = '123'; ksort($post_parameters); // Sort parameters by key ascending if (0 < count($post_parameters)) { // Generate URL-encoded query string $concatted_post_parameters = http_build_query($post_parameters, '', '&'); } $hmac_data = implode('#', array($http_method, $uri, $api_key, $nonce, md5($concatted_post_parameters))); $hmac = hash_hmac('sha256', $hmac_data, $secret); print($hmac_data);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 19
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/v8DhB
function name:  (null)
number of ops:  40
compiled vars:  !0 = $post_parameters, !1 = $concatted_post_parameters, !2 = $http_method, !3 = $uri, !4 = $api_key, !5 = $nonce, !6 = $secret, !7 = $hmac_data, !8 = $hmac
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, ''
    5     2        ASSIGN                                                   !2, 'METHOD'
    6     3        ASSIGN                                                   !3, 'API'
    7     4        ASSIGN                                                   !4, '789'
    8     5        ASSIGN                                                   !5, 555
    9     6        ASSIGN                                                   !6, '123'
   11     7        INIT_FCALL                                               'ksort'
          8        SEND_REF                                                 !0
          9        DO_ICALL                                                 
   13    10        COUNT                                            ~17     !0
         11        IS_SMALLER                                               0, ~17
         12      > JMPZ                                                     ~18, ->19
   16    13    >   INIT_FCALL                                               'http_build_query'
         14        SEND_VAR                                                 !0
         15        SEND_VAL                                                 ''
         16        SEND_VAL                                                 '%26'
         17        DO_ICALL                                         $19     
         18        ASSIGN                                                   !1, $19
   19    19    >   INIT_FCALL                                               'implode'
         20        SEND_VAL                                                 '%23'
         21        INIT_ARRAY                                       ~21     !2
         22        ADD_ARRAY_ELEMENT                                ~21     !3
         23        ADD_ARRAY_ELEMENT                                ~21     !4
         24        ADD_ARRAY_ELEMENT                                ~21     !5
         25        INIT_FCALL                                               'md5'
         26        SEND_VAR                                                 !1
         27        DO_ICALL                                         $22     
         28        ADD_ARRAY_ELEMENT                                ~21     $22
         29        SEND_VAL                                                 ~21
         30        DO_ICALL                                         $23     
         31        ASSIGN                                                   !7, $23
   20    32        INIT_FCALL                                               'hash_hmac'
         33        SEND_VAL                                                 'sha256'
         34        SEND_VAR                                                 !7
         35        SEND_VAR                                                 !6
         36        DO_ICALL                                         $25     
         37        ASSIGN                                                   !8, $25
   21    38        ECHO                                                     !7
         39      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.85 ms | 1401 KiB | 23 Q