3v4l.org

run code in 300+ PHP versions simultaneously
<?php $url = "https://101@dev.ewingirrigation.com/rest/"; $api_key = 'gSJ5^sVWAWb=L#HAyVXd^WK+_WpX2kew'; $ts = time(); $salt = substr($ts,0,-2); $hash = hash("sha256", $api_key.$salt); $postfields = Array( 'hash' => $hash, 'ts' => $ts ); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, utf8_encode(json_encode($postfields))); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded')); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_VERBOSE, true); curl_setopt($ch, CURLOPT_COOKIEJAR, '/tmp'); $response = curl_exec($ch) or die('no curl '.curl_error($ch)); $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE); $header = substr($response, 0, $header_size); $body = substr($response, $header_size); echo "<pre>"; echo $header; echo "<hr>"; print_r($body);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 88, Position 2 = 94
Branch analysis from position: 88
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 94
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/f3cli
function name:  (null)
number of ops:  118
compiled vars:  !0 = $url, !1 = $api_key, !2 = $ts, !3 = $salt, !4 = $hash, !5 = $postfields, !6 = $ch, !7 = $response, !8 = $header_size, !9 = $header, !10 = $body
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'https%3A%2F%2F101%40dev.ewingirrigation.com%2Frest%2F'
    3     1        ASSIGN                                                   !1, 'gSJ5%5EsVWAWb%3DL%23HAyVXd%5EWK%2B_WpX2kew'
    4     2        INIT_FCALL                                               'time'
          3        DO_ICALL                                         $13     
          4        ASSIGN                                                   !2, $13
    5     5        INIT_FCALL                                               'substr'
          6        SEND_VAR                                                 !2
          7        SEND_VAL                                                 0
          8        SEND_VAL                                                 -2
          9        DO_ICALL                                         $15     
         10        ASSIGN                                                   !3, $15
    6    11        INIT_FCALL                                               'hash'
         12        SEND_VAL                                                 'sha256'
         13        CONCAT                                           ~17     !1, !3
         14        SEND_VAL                                                 ~17
         15        DO_ICALL                                         $18     
         16        ASSIGN                                                   !4, $18
    8    17        INIT_ARRAY                                       ~20     !4, 'hash'
    9    18        ADD_ARRAY_ELEMENT                                ~20     !2, 'ts'
    7    19        ASSIGN                                                   !5, ~20
   11    20        INIT_FCALL_BY_NAME                                       'curl_init'
         21        DO_FCALL                                      0  $22     
         22        ASSIGN                                                   !6, $22
   12    23        INIT_FCALL_BY_NAME                                       'curl_setopt'
         24        SEND_VAR_EX                                              !6
         25        FETCH_CONSTANT                                   ~24     'CURLOPT_URL'
         26        SEND_VAL_EX                                              ~24
         27        SEND_VAR_EX                                              !0
         28        DO_FCALL                                      0          
   13    29        INIT_FCALL_BY_NAME                                       'curl_setopt'
         30        SEND_VAR_EX                                              !6
         31        FETCH_CONSTANT                                   ~26     'CURLOPT_POST'
         32        SEND_VAL_EX                                              ~26
         33        SEND_VAL_EX                                              <true>
         34        DO_FCALL                                      0          
   14    35        INIT_FCALL_BY_NAME                                       'curl_setopt'
         36        SEND_VAR_EX                                              !6
         37        FETCH_CONSTANT                                   ~28     'CURLOPT_POSTFIELDS'
         38        SEND_VAL_EX                                              ~28
         39        INIT_FCALL                                               'utf8_encode'
         40        INIT_FCALL                                               'json_encode'
         41        SEND_VAR                                                 !5
         42        DO_ICALL                                         $29     
         43        SEND_VAR                                                 $29
         44        DO_FCALL_BY_NAME                                         
         45        SEND_VAR_NO_REF_EX                                       $30
         46        DO_FCALL                                      0          
   15    47        INIT_FCALL_BY_NAME                                       'curl_setopt'
         48        SEND_VAR_EX                                              !6
         49        FETCH_CONSTANT                                   ~32     'CURLOPT_RETURNTRANSFER'
         50        SEND_VAL_EX                                              ~32
         51        SEND_VAL_EX                                              <true>
         52        DO_FCALL                                      0          
   16    53        INIT_FCALL_BY_NAME                                       'curl_setopt'
         54        SEND_VAR_EX                                              !6
         55        FETCH_CONSTANT                                   ~34     'CURLOPT_HTTPHEADER'
         56        SEND_VAL_EX                                              ~34
         57        SEND_VAL_EX                                              <array>
         58        DO_FCALL                                      0          
   17    59        INIT_FCALL_BY_NAME                                       'curl_setopt'
         60        SEND_VAR_EX                                              !6
         61        FETCH_CONSTANT                                   ~36     'CURLOPT_SSL_VERIFYPEER'
         62        SEND_VAL_EX                                              ~36
         63        SEND_VAL_EX                                              <false>
         64        DO_FCALL                                      0          
   18    65        INIT_FCALL_BY_NAME                                       'curl_setopt'
         66        SEND_VAR_EX                                              !6
         67        FETCH_CONSTANT                                   ~38     'CURLOPT_HEADER'
         68        SEND_VAL_EX                                              ~38
         69        SEND_VAL_EX                                              <true>
         70        DO_FCALL                                      0          
   19    71        INIT_FCALL_BY_NAME                                       'curl_setopt'
         72        SEND_VAR_EX                                              !6
         73        FETCH_CONSTANT                                   ~40     'CURLOPT_VERBOSE'
         74        SEND_VAL_EX                                              ~40
         75        SEND_VAL_EX                                              <true>
         76        DO_FCALL                                      0          
   20    77        INIT_FCALL_BY_NAME                                       'curl_setopt'
         78        SEND_VAR_EX                                              !6
         79        FETCH_CONSTANT                                   ~42     'CURLOPT_COOKIEJAR'
         80        SEND_VAL_EX                                              ~42
         81        SEND_VAL_EX                                              '%2Ftmp'
         82        DO_FCALL                                      0          
   21    83        INIT_FCALL_BY_NAME                                       'curl_exec'
         84        SEND_VAR_EX                                              !6
         85        DO_FCALL                                      0  $44     
         86        ASSIGN                                           ~45     !7, $44
         87      > JMPNZ_EX                                         ~45     ~45, ->94
         88    >   INIT_FCALL_BY_NAME                                       'curl_error'
         89        SEND_VAR_EX                                              !6
         90        DO_FCALL                                      0  $46     
         91        CONCAT                                           ~47     'no+curl+', $46
         92      > EXIT                                                     ~47
         93*       BOOL                                             ~45     <true>
   22    94    >   INIT_FCALL_BY_NAME                                       'curl_getinfo'
         95        SEND_VAR_EX                                              !6
         96        FETCH_CONSTANT                                   ~48     'CURLINFO_HEADER_SIZE'
         97        SEND_VAL_EX                                              ~48
         98        DO_FCALL                                      0  $49     
         99        ASSIGN                                                   !8, $49
   23   100        INIT_FCALL                                               'substr'
        101        SEND_VAR                                                 !7
        102        SEND_VAL                                                 0
        103        SEND_VAR                                                 !8
        104        DO_ICALL                                         $51     
        105        ASSIGN                                                   !9, $51
   24   106        INIT_FCALL                                               'substr'
        107        SEND_VAR                                                 !7
        108        SEND_VAR                                                 !8
        109        DO_ICALL                                         $53     
        110        ASSIGN                                                   !10, $53
   25   111        ECHO                                                     '%3Cpre%3E'
   26   112        ECHO                                                     !9
   27   113        ECHO                                                     '%3Chr%3E'
   28   114        INIT_FCALL                                               'print_r'
        115        SEND_VAR                                                 !10
        116        DO_ICALL                                                 
        117      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.84 ms | 1015 KiB | 19 Q