3v4l.org

run code in 300+ PHP versions simultaneously
<?php $cookieFile = "cookies.txt"; if(!file_exists($cookieFile)) { $fh = fopen($cookieFile, "w"); fwrite($fh, ""); fclose($fh); } $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_RETURNTRANSFER => 1, CURLOPT_URL => 'http://localhost/mysite/test.php?data=hello', CURLOPT_HEADER => false, CURLOPT_COOKIESESSION=>true, CURLOPT_COOKIEFILE => $cookieFile, CURLOPT_COOKIEJAR => $cookieFile )); $resp = curl_exec($curl); curl_close($curl); echo $resp; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 18
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/RVEkr
function name:  (null)
number of ops:  46
compiled vars:  !0 = $cookieFile, !1 = $fh, !2 = $curl, !3 = $resp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'cookies.txt'
    3     1        INIT_FCALL                                               'file_exists'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $5      
          4        BOOL_NOT                                         ~6      $5
          5      > JMPZ                                                     ~6, ->18
    4     6    >   INIT_FCALL                                               'fopen'
          7        SEND_VAR                                                 !0
          8        SEND_VAL                                                 'w'
          9        DO_ICALL                                         $7      
         10        ASSIGN                                                   !1, $7
    5    11        INIT_FCALL                                               'fwrite'
         12        SEND_VAR                                                 !1
         13        SEND_VAL                                                 ''
         14        DO_ICALL                                                 
    6    15        INIT_FCALL                                               'fclose'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                                 
   12    18    >   INIT_FCALL_BY_NAME                                       'curl_init'
         19        DO_FCALL                                      0  $11     
         20        ASSIGN                                                   !2, $11
   14    21        INIT_FCALL_BY_NAME                                       'curl_setopt_array'
         22        SEND_VAR_EX                                              !2
   15    23        FETCH_CONSTANT                                   ~13     'CURLOPT_RETURNTRANSFER'
         24        INIT_ARRAY                                       ~14     1, ~13
   16    25        FETCH_CONSTANT                                   ~15     'CURLOPT_URL'
         26        ADD_ARRAY_ELEMENT                                ~14     'http%3A%2F%2Flocalhost%2Fmysite%2Ftest.php%3Fdata%3Dhello', ~15
   17    27        FETCH_CONSTANT                                   ~16     'CURLOPT_HEADER'
   15    28        ADD_ARRAY_ELEMENT                                ~14     <false>, ~16
   18    29        FETCH_CONSTANT                                   ~17     'CURLOPT_COOKIESESSION'
   15    30        ADD_ARRAY_ELEMENT                                ~14     <true>, ~17
   19    31        FETCH_CONSTANT                                   ~18     'CURLOPT_COOKIEFILE'
         32        ADD_ARRAY_ELEMENT                                ~14     !0, ~18
   20    33        FETCH_CONSTANT                                   ~19     'CURLOPT_COOKIEJAR'
         34        ADD_ARRAY_ELEMENT                                ~14     !0, ~19
         35        SEND_VAL_EX                                              ~14
   14    36        DO_FCALL                                      0          
   25    37        INIT_FCALL_BY_NAME                                       'curl_exec'
         38        SEND_VAR_EX                                              !2
         39        DO_FCALL                                      0  $21     
         40        ASSIGN                                                   !3, $21
   27    41        INIT_FCALL_BY_NAME                                       'curl_close'
         42        SEND_VAR_EX                                              !2
         43        DO_FCALL                                      0          
   29    44        ECHO                                                     !3
   33    45      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.78 ms | 1006 KiB | 17 Q