3v4l.org

run code in 300+ PHP versions simultaneously
<?php $verificationCode = '6g8998f53f98d69cbdf07c789a7ec1284b9gaeab573a0dc94e76a4db9ceg21a4'; $request = [ "title" => "57c58ce24b1e15e8358b4568", "body" => "57c58ce24b1e15e8358b4568", "charset" => "UTF-8", "isApp" => "app", "defaultbank" => "ICBC", "merchantId" => "100000000002698", "notifyUrl" => "https://requestb.in/12q245v1", "orderNo" => "57c58ce24b1e15e8358b4568", "paymentType" => "1", "paymethod" => "directPay", "returnUrl" => "http://china.isitdomain.com", "service" => "online_pay", "totalFee" => "1.0" ]; // var_dump($request); $request = array_filter($request); // var_dump($request); ksort($request); var_dump($request); // $signParams = []; // foreach ($request as $key => $value) { // $signParams[] = "{$key}={$value}"; // } // $rawSign = implode('&', $signParams) . $verificationCode; $rawSign = http_build_query($request) . $verificationCode; var_dump($rawSign); $sign = strtoupper(sha1($rawSign)); $url = "https://ebank.ztpo.cn/payment/v1/order/100000000002698-57c58ce24b1e15e8358b4567?"; $request['signType'] = 'SHA'; $request['sign'] = $sign; $readyUrl = $url . http_build_query($request); echo $sign, PHP_EOL; echo $readyUrl, PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pfqoa
function name:  (null)
number of ops:  42
compiled vars:  !0 = $verificationCode, !1 = $request, !2 = $rawSign, !3 = $sign, !4 = $url, !5 = $readyUrl
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '6g8998f53f98d69cbdf07c789a7ec1284b9gaeab573a0dc94e76a4db9ceg21a4'
    5     1        ASSIGN                                                   !1, <array>
   21     2        INIT_FCALL                                               'array_filter'
          3        SEND_VAR                                                 !1
          4        DO_ICALL                                         $8      
          5        ASSIGN                                                   !1, $8
   23     6        INIT_FCALL                                               'ksort'
          7        SEND_REF                                                 !1
          8        DO_ICALL                                                 
   24     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                                 
   32    12        INIT_FCALL                                               'http_build_query'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                         $12     
         15        CONCAT                                           ~13     $12, !0
         16        ASSIGN                                                   !2, ~13
   33    17        INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                                 
   35    20        INIT_FCALL                                               'strtoupper'
         21        INIT_FCALL                                               'sha1'
         22        SEND_VAR                                                 !2
         23        DO_ICALL                                         $16     
         24        SEND_VAR                                                 $16
         25        DO_ICALL                                         $17     
         26        ASSIGN                                                   !3, $17
   37    27        ASSIGN                                                   !4, 'https%3A%2F%2Febank.ztpo.cn%2Fpayment%2Fv1%2Forder%2F100000000002698-57c58ce24b1e15e8358b4567%3F'
   38    28        ASSIGN_DIM                                               !1, 'signType'
         29        OP_DATA                                                  'SHA'
   39    30        ASSIGN_DIM                                               !1, 'sign'
         31        OP_DATA                                                  !3
   41    32        INIT_FCALL                                               'http_build_query'
         33        SEND_VAR                                                 !1
         34        DO_ICALL                                         $22     
         35        CONCAT                                           ~23     !4, $22
         36        ASSIGN                                                   !5, ~23
   42    37        ECHO                                                     !3
         38        ECHO                                                     '%0A'
   43    39        ECHO                                                     !5
         40        ECHO                                                     '%0A'
         41      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.93 ms | 1466 KiB | 19 Q