3v4l.org

run code in 300+ PHP versions simultaneously
<?php $accessID = "09d67621"; $secretKey = "c0ab83a5057b00d294a2b7531ce21236"; $expires = mktime() + 300; // The request is good for the next 5 minutes, or 300 seconds from now. $stringToSign = $accessID."\n".$expires; // Get the "raw" or binary output of the hmac hash. $binarySignature = hash_hmac('sha1', $stringToSign, $secretKey, true); // We need to base64-encode it and then url-encode that. $urlSafeSignature = urlencode(base64_encode($binarySignature)); $urlToFetch = "http://api3.wordtracker.com/search?keyword=cheap&app_id=09d67621&app_key=c0ab83a5057b00d294a2b7531ce21236&limit=3"; echo $urlToFetch; $curl_handle = curl_init(); curl_setopt($curl_handle, CURLOPT_URL, $urlToFetch); curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 120); curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1); $buffer = curl_exec($curl_handle); curl_close($curl_handle); $buffer=utf8_encode($buffer); $arr = json_decode($buffer); print_r($arr); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/T0uVq
function name:  (null)
number of ops:  65
compiled vars:  !0 = $accessID, !1 = $secretKey, !2 = $expires, !3 = $stringToSign, !4 = $binarySignature, !5 = $urlSafeSignature, !6 = $urlToFetch, !7 = $curl_handle, !8 = $buffer, !9 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '09d67621'
    4     1        ASSIGN                                                   !1, 'c0ab83a5057b00d294a2b7531ce21236'
    5     2        INIT_FCALL                                               'mktime'
          3        DO_ICALL                                         $12     
          4        ADD                                              ~13     $12, 300
          5        ASSIGN                                                   !2, ~13
    6     6        CONCAT                                           ~15     !0, '%0A'
          7        CONCAT                                           ~16     ~15, !2
          8        ASSIGN                                                   !3, ~16
    9     9        INIT_FCALL                                               'hash_hmac'
         10        SEND_VAL                                                 'sha1'
         11        SEND_VAR                                                 !3
         12        SEND_VAR                                                 !1
         13        SEND_VAL                                                 <true>
         14        DO_ICALL                                         $18     
         15        ASSIGN                                                   !4, $18
   12    16        INIT_FCALL                                               'urlencode'
         17        INIT_FCALL                                               'base64_encode'
         18        SEND_VAR                                                 !4
         19        DO_ICALL                                         $20     
         20        SEND_VAR                                                 $20
         21        DO_ICALL                                         $21     
         22        ASSIGN                                                   !5, $21
   13    23        ASSIGN                                                   !6, 'http%3A%2F%2Fapi3.wordtracker.com%2Fsearch%3Fkeyword%3Dcheap%26app_id%3D09d67621%26app_key%3Dc0ab83a5057b00d294a2b7531ce21236%26limit%3D3'
   14    24        ECHO                                                     !6
   15    25        INIT_FCALL_BY_NAME                                       'curl_init'
         26        DO_FCALL                                      0  $24     
         27        ASSIGN                                                   !7, $24
   16    28        INIT_FCALL_BY_NAME                                       'curl_setopt'
         29        SEND_VAR_EX                                              !7
         30        FETCH_CONSTANT                                   ~26     'CURLOPT_URL'
         31        SEND_VAL_EX                                              ~26
         32        SEND_VAR_EX                                              !6
         33        DO_FCALL                                      0          
   17    34        INIT_FCALL_BY_NAME                                       'curl_setopt'
         35        SEND_VAR_EX                                              !7
         36        FETCH_CONSTANT                                   ~28     'CURLOPT_CONNECTTIMEOUT'
         37        SEND_VAL_EX                                              ~28
         38        SEND_VAL_EX                                              120
         39        DO_FCALL                                      0          
   18    40        INIT_FCALL_BY_NAME                                       'curl_setopt'
         41        SEND_VAR_EX                                              !7
         42        FETCH_CONSTANT                                   ~30     'CURLOPT_RETURNTRANSFER'
         43        SEND_VAL_EX                                              ~30
         44        SEND_VAL_EX                                              1
         45        DO_FCALL                                      0          
   19    46        INIT_FCALL_BY_NAME                                       'curl_exec'
         47        SEND_VAR_EX                                              !7
         48        DO_FCALL                                      0  $32     
         49        ASSIGN                                                   !8, $32
   20    50        INIT_FCALL_BY_NAME                                       'curl_close'
         51        SEND_VAR_EX                                              !7
         52        DO_FCALL                                      0          
   21    53        INIT_FCALL                                               'utf8_encode'
         54        SEND_VAR                                                 !8
         55        DO_ICALL                                         $35     
         56        ASSIGN                                                   !8, $35
   22    57        INIT_FCALL                                               'json_decode'
         58        SEND_VAR                                                 !8
         59        DO_ICALL                                         $37     
         60        ASSIGN                                                   !9, $37
   23    61        INIT_FCALL                                               'print_r'
         62        SEND_VAR                                                 !9
         63        DO_ICALL                                                 
   24    64      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.61 ms | 1400 KiB | 27 Q