3v4l.org

run code in 300+ PHP versions simultaneously
<?php $username = "robstark@winterfell.com"; $secretKey = sha1("L1v3rp00@"); $verb = "GET"; $body = json_encode("{\"Request\":{\"satn\":\"213456\"},\"emailAddress\":\"robstark@winterfell.com\"}"); $contentmd5 = base64_encode(md5($body, true)); $contentType = "application/json"; $dateNow = gmdate("c"); $authCode = base64_encode(hash_hmac("sha1", $verb . "\n" . $contentmd5 . "\n" . $contentType . "\n" . $dateNow, $secretKey)); $ch = curl_init("http://conapi.reddotnetwork.com/1.0/consumer"); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $verb); curl_setopt($ch, CURLOPT_POSTFIELDS, $body); curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json","Content-Length: " . strlen($body),"Content-MD5: " .$contentmd5, "Authorization: RDN " . $username, ":". ":" . $authCode));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/O7rvl
function name:  (null)
number of ops:  71
compiled vars:  !0 = $username, !1 = $secretKey, !2 = $verb, !3 = $body, !4 = $contentmd5, !5 = $contentType, !6 = $dateNow, !7 = $authCode, !8 = $ch
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'robstark%40winterfell.com'
    3     1        INIT_FCALL                                               'sha1'
          2        SEND_VAL                                                 'L1v3rp00%40'
          3        DO_ICALL                                         $10     
          4        ASSIGN                                                   !1, $10
    4     5        ASSIGN                                                   !2, 'GET'
    5     6        INIT_FCALL                                               'json_encode'
          7        SEND_VAL                                                 '%7B%22Request%22%3A%7B%22satn%22%3A%22213456%22%7D%2C%22emailAddress%22%3A%22robstark%40winterfell.com%22%7D'
          8        DO_ICALL                                         $13     
          9        ASSIGN                                                   !3, $13
    6    10        INIT_FCALL                                               'base64_encode'
         11        INIT_FCALL                                               'md5'
         12        SEND_VAR                                                 !3
         13        SEND_VAL                                                 <true>
         14        DO_ICALL                                         $15     
         15        SEND_VAR                                                 $15
         16        DO_ICALL                                         $16     
         17        ASSIGN                                                   !4, $16
    7    18        ASSIGN                                                   !5, 'application%2Fjson'
    8    19        INIT_FCALL                                               'gmdate'
         20        SEND_VAL                                                 'c'
         21        DO_ICALL                                         $19     
         22        ASSIGN                                                   !6, $19
    9    23        INIT_FCALL                                               'base64_encode'
         24        INIT_FCALL                                               'hash_hmac'
         25        SEND_VAL                                                 'sha1'
         26        CONCAT                                           ~21     !2, '%0A'
         27        CONCAT                                           ~22     ~21, !4
         28        CONCAT                                           ~23     ~22, '%0A'
         29        CONCAT                                           ~24     ~23, !5
         30        CONCAT                                           ~25     ~24, '%0A'
         31        CONCAT                                           ~26     ~25, !6
         32        SEND_VAL                                                 ~26
         33        SEND_VAR                                                 !1
         34        DO_ICALL                                         $27     
         35        SEND_VAR                                                 $27
         36        DO_ICALL                                         $28     
         37        ASSIGN                                                   !7, $28
   10    38        INIT_FCALL_BY_NAME                                       'curl_init'
         39        SEND_VAL_EX                                              'http%3A%2F%2Fconapi.reddotnetwork.com%2F1.0%2Fconsumer'
         40        DO_FCALL                                      0  $30     
         41        ASSIGN                                                   !8, $30
   11    42        INIT_FCALL_BY_NAME                                       'curl_setopt'
         43        SEND_VAR_EX                                              !8
         44        FETCH_CONSTANT                                   ~32     'CURLOPT_CUSTOMREQUEST'
         45        SEND_VAL_EX                                              ~32
         46        SEND_VAR_EX                                              !2
         47        DO_FCALL                                      0          
   12    48        INIT_FCALL_BY_NAME                                       'curl_setopt'
         49        SEND_VAR_EX                                              !8
         50        FETCH_CONSTANT                                   ~34     'CURLOPT_POSTFIELDS'
         51        SEND_VAL_EX                                              ~34
         52        SEND_VAR_EX                                              !3
         53        DO_FCALL                                      0          
   13    54        INIT_FCALL_BY_NAME                                       'curl_setopt'
         55        SEND_VAR_EX                                              !8
         56        FETCH_CONSTANT                                   ~36     'CURLOPT_HTTPHEADER'
         57        SEND_VAL_EX                                              ~36
         58        INIT_ARRAY                                       ~37     'Content-Type%3A+application%2Fjson'
         59        STRLEN                                           ~38     !3
         60        CONCAT                                           ~39     'Content-Length%3A+', ~38
         61        ADD_ARRAY_ELEMENT                                ~37     ~39
         62        CONCAT                                           ~40     'Content-MD5%3A+', !4
         63        ADD_ARRAY_ELEMENT                                ~37     ~40
         64        CONCAT                                           ~41     'Authorization%3A+RDN+', !0
         65        ADD_ARRAY_ELEMENT                                ~37     ~41
         66        CONCAT                                           ~42     '%3A%3A', !7
         67        ADD_ARRAY_ELEMENT                                ~37     ~42
         68        SEND_VAL_EX                                              ~37
         69        DO_FCALL                                      0          
         70      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
264.17 ms | 1400 KiB | 26 Q