3v4l.org

run code in 300+ PHP versions simultaneously
<?php $parametersForSign = array( 'merchant-pos-id' => '185641', 'shop-name' => 'Název obchodu', 'total-amount' => '9.99', 'currency-code' => 'CZK', 'customer-language' => 'cs', 'customer-email' => 'email@exampledomain.com', ); $privateKey = 'db96e2ee781bb2045cc100db82f5944b'; function sigCalculate($parametersForSign, $privateKey) { ksort($parametersForSign); echo implode('', $parametersForSign); return hash('sha256', implode('', $parametersForSign).$privateKey); } echo sigCalculate($parametersForSign, $privateKey); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pPgfI
function name:  (null)
number of ops:  8
compiled vars:  !0 = $parametersForSign, !1 = $privateKey
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   10     1        ASSIGN                                                   !1, 'db96e2ee781bb2045cc100db82f5944b'
   17     2        INIT_FCALL                                               'sigcalculate'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_FCALL                                      0  $4      
          6        ECHO                                                     $4
   18     7      > RETURN                                                   1

Function sigcalculate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pPgfI
function name:  sigCalculate
number of ops:  21
compiled vars:  !0 = $parametersForSign, !1 = $privateKey
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   13     2        INIT_FCALL                                               'ksort'
          3        SEND_REF                                                 !0
          4        DO_ICALL                                                 
   14     5        INIT_FCALL                                               'implode'
          6        SEND_VAL                                                 ''
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $3      
          9        ECHO                                                     $3
   15    10        INIT_FCALL                                               'hash'
         11        SEND_VAL                                                 'sha256'
         12        INIT_FCALL                                               'implode'
         13        SEND_VAL                                                 ''
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $4      
         16        CONCAT                                           ~5      $4, !1
         17        SEND_VAL                                                 ~5
         18        DO_ICALL                                         $6      
         19      > RETURN                                                   $6
   16    20*     > RETURN                                                   null

End of function sigcalculate

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.98 ms | 1399 KiB | 20 Q