3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Get your access id and secret key here: https://moz.com/products/api/keys $accessID = "mozscape-02c27682b8"; $secretKey = "23d89133205a7b46f944ea6ddb2fead2"; // Set your expires times for several minutes into the future. // An expires time excessively far in the future will not be honored by the Mozscape API. $expires = time() + 300; // Put each parameter on a new line. $stringToSign = $accessID."\n".$expires; // Get the "raw" or binary output of the hmac hash. $binarySignature = hash_hmac('sha1', $stringToSign, $secretKey, true); // Base64-encode it and then url-encode that. $urlSafeSignature = urlencode(base64_encode($binarySignature)); // Add up all the bit flags you want returned. // Learn more here: https://moz.com/help/guides/moz-api/mozscape/api-reference/url-metrics $cols = "34359738368"; // Put it all together and you get your request URL. $requestUrl = "http://lsapi.seomoz.com/linkscape/url-metrics/?Cols=".$cols."&AccessID=".$accessID."&Expires=".$expires."&Signature=".$urlSafeSignature; // Put your URLS into an array and json_encode them. $batchedDomains = array('www.moz.com', 'www.apple.com', 'www.pizza.com'); $encodedDomains = json_encode($batchedDomains); // Use Curl to send off your request. // Send your encoded list of domains through Curl's POSTFIELDS. $options = array( CURLOPT_RETURNTRANSFER => true, CURLOPT_POSTFIELDS => $encodedDomains ); $ch = curl_init($requestUrl); curl_setopt_array($ch, $options); $content = curl_exec($ch); curl_close( $ch ); $contents = json_decode($content); print_r($contents); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r4dJZ
function name:  (null)
number of ops:  65
compiled vars:  !0 = $accessID, !1 = $secretKey, !2 = $expires, !3 = $stringToSign, !4 = $binarySignature, !5 = $urlSafeSignature, !6 = $cols, !7 = $requestUrl, !8 = $batchedDomains, !9 = $encodedDomains, !10 = $options, !11 = $ch, !12 = $content, !13 = $contents
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'mozscape-02c27682b8'
    4     1        ASSIGN                                                   !1, '23d89133205a7b46f944ea6ddb2fead2'
    7     2        INIT_FCALL                                               'time'
          3        DO_ICALL                                         $16     
          4        ADD                                              ~17     $16, 300
          5        ASSIGN                                                   !2, ~17
    9     6        CONCAT                                           ~19     !0, '%0A'
          7        CONCAT                                           ~20     ~19, !2
          8        ASSIGN                                                   !3, ~20
   11     9        INIT_FCALL                                               'hash_hmac'
         10        SEND_VAL                                                 'sha1'
         11        SEND_VAR                                                 !3
         12        SEND_VAR                                                 !1
         13        SEND_VAL                                                 <true>
         14        DO_ICALL                                         $22     
         15        ASSIGN                                                   !4, $22
   13    16        INIT_FCALL                                               'urlencode'
         17        INIT_FCALL                                               'base64_encode'
         18        SEND_VAR                                                 !4
         19        DO_ICALL                                         $24     
         20        SEND_VAR                                                 $24
         21        DO_ICALL                                         $25     
         22        ASSIGN                                                   !5, $25
   16    23        ASSIGN                                                   !6, '34359738368'
   18    24        CONCAT                                           ~28     'http%3A%2F%2Flsapi.seomoz.com%2Flinkscape%2Furl-metrics%2F%3FCols%3D', !6
         25        CONCAT                                           ~29     ~28, '%26AccessID%3D'
         26        CONCAT                                           ~30     ~29, !0
         27        CONCAT                                           ~31     ~30, '%26Expires%3D'
         28        CONCAT                                           ~32     ~31, !2
         29        CONCAT                                           ~33     ~32, '%26Signature%3D'
         30        CONCAT                                           ~34     ~33, !5
         31        ASSIGN                                                   !7, ~34
   20    32        ASSIGN                                                   !8, <array>
   21    33        INIT_FCALL                                               'json_encode'
         34        SEND_VAR                                                 !8
         35        DO_ICALL                                         $37     
         36        ASSIGN                                                   !9, $37
   25    37        FETCH_CONSTANT                                   ~39     'CURLOPT_RETURNTRANSFER'
         38        INIT_ARRAY                                       ~40     <true>, ~39
   26    39        FETCH_CONSTANT                                   ~41     'CURLOPT_POSTFIELDS'
         40        ADD_ARRAY_ELEMENT                                ~40     !9, ~41
   24    41        ASSIGN                                                   !10, ~40
   28    42        INIT_FCALL_BY_NAME                                       'curl_init'
         43        SEND_VAR_EX                                              !7
         44        DO_FCALL                                      0  $43     
         45        ASSIGN                                                   !11, $43
   29    46        INIT_FCALL_BY_NAME                                       'curl_setopt_array'
         47        SEND_VAR_EX                                              !11
         48        SEND_VAR_EX                                              !10
         49        DO_FCALL                                      0          
   30    50        INIT_FCALL_BY_NAME                                       'curl_exec'
         51        SEND_VAR_EX                                              !11
         52        DO_FCALL                                      0  $46     
         53        ASSIGN                                                   !12, $46
   31    54        INIT_FCALL_BY_NAME                                       'curl_close'
         55        SEND_VAR_EX                                              !11
         56        DO_FCALL                                      0          
   32    57        INIT_FCALL                                               'json_decode'
         58        SEND_VAR                                                 !12
         59        DO_ICALL                                         $49     
         60        ASSIGN                                                   !13, $49
   33    61        INIT_FCALL                                               'print_r'
         62        SEND_VAR                                                 !13
         63        DO_ICALL                                                 
   34    64      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.18 ms | 1400 KiB | 27 Q