3v4l.org

run code in 300+ PHP versions simultaneously
<?php function microtime_float() { list($usec, $sec) = explode(" ", microtime()); return ((float)$usec + (float)$sec); } function storefile() { $filename = "10mb.test"; //$time_start = microtime_float(); $filecontent = file_get_contents("http://cachefly.cachefly.net/10mb.test"); //$time_end = microtime_float(); //$time = $time_end - $time_start; //$speed = 10 / $time; //echo "File Downloaded with" . $speed . " Mb/s of speed."; apc_store($filename,$filecontent); } function fetchfile() { $filename = "10mb.test"; $file = apc_fetch($filename); $quoted = sprintf('"%s"', addcslashes(basename($filename), '"\\')); $size = filesize($file); header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename=' . $quoted); header('Content-Transfer-Encoding: binary'); header('Connection: Keep-Alive'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); header('Content-Length: ' . $size); echo $file; } storefile(); fetchfile();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uJDuq
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   40     0  E >   INIT_FCALL                                               'storefile'
          1        DO_FCALL                                      0          
   41     2        INIT_FCALL                                               'fetchfile'
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Function microtime_float:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uJDuq
function name:  microtime_float
number of ops:  16
compiled vars:  !0 = $usec, !1 = $sec
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_FCALL                                               'explode'
          1        SEND_VAL                                                 '+'
          2        INIT_FCALL                                               'microtime'
          3        DO_ICALL                                         $2      
          4        SEND_VAR                                                 $2
          5        DO_ICALL                                         $3      
          6        FETCH_LIST_R                                     $4      $3, 0
          7        ASSIGN                                                   !0, $4
          8        FETCH_LIST_R                                     $6      $3, 1
          9        ASSIGN                                                   !1, $6
         10        FREE                                                     $3
    6    11        CAST                                          5  ~8      !0
         12        CAST                                          5  ~9      !1
         13        ADD                                              ~10     ~8, ~9
         14      > RETURN                                                   ~10
    7    15*     > RETURN                                                   null

End of function microtime_float

Function storefile:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uJDuq
function name:  storefile
number of ops:  10
compiled vars:  !0 = $filename, !1 = $filecontent
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ASSIGN                                                   !0, '10mb.test'
   13     1        INIT_FCALL                                               'file_get_contents'
          2        SEND_VAL                                                 'http%3A%2F%2Fcachefly.cachefly.net%2F10mb.test'
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !1, $3
   18     5        INIT_FCALL_BY_NAME                                       'apc_store'
          6        SEND_VAR_EX                                              !0
          7        SEND_VAR_EX                                              !1
          8        DO_FCALL                                      0          
   19     9      > RETURN                                                   null

End of function storefile

Function fetchfile:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uJDuq
function name:  fetchfile
number of ops:  52
compiled vars:  !0 = $filename, !1 = $file, !2 = $quoted, !3 = $size
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   ASSIGN                                                   !0, '10mb.test'
   24     1        INIT_FCALL_BY_NAME                                       'apc_fetch'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $5      
          4        ASSIGN                                                   !1, $5
   25     5        INIT_FCALL                                               'sprintf'
          6        SEND_VAL                                                 '%22%25s%22'
          7        INIT_FCALL                                               'addcslashes'
          8        INIT_FCALL                                               'basename'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $7      
         11        SEND_VAR                                                 $7
         12        SEND_VAL                                                 '%22%5C'
         13        DO_ICALL                                         $8      
         14        SEND_VAR                                                 $8
         15        DO_ICALL                                         $9      
         16        ASSIGN                                                   !2, $9
   26    17        INIT_FCALL                                               'filesize'
         18        SEND_VAR                                                 !1
         19        DO_ICALL                                         $11     
         20        ASSIGN                                                   !3, $11
   27    21        INIT_FCALL                                               'header'
         22        SEND_VAL                                                 'Content-Description%3A+File+Transfer'
         23        DO_ICALL                                                 
   28    24        INIT_FCALL                                               'header'
         25        SEND_VAL                                                 'Content-Type%3A+application%2Foctet-stream'
         26        DO_ICALL                                                 
   29    27        INIT_FCALL                                               'header'
         28        CONCAT                                           ~15     'Content-Disposition%3A+attachment%3B+filename%3D', !2
         29        SEND_VAL                                                 ~15
         30        DO_ICALL                                                 
   30    31        INIT_FCALL                                               'header'
         32        SEND_VAL                                                 'Content-Transfer-Encoding%3A+binary'
         33        DO_ICALL                                                 
   31    34        INIT_FCALL                                               'header'
         35        SEND_VAL                                                 'Connection%3A+Keep-Alive'
         36        DO_ICALL                                                 
   32    37        INIT_FCALL                                               'header'
         38        SEND_VAL                                                 'Expires%3A+0'
         39        DO_ICALL                                                 
   33    40        INIT_FCALL                                               'header'
         41        SEND_VAL                                                 'Cache-Control%3A+must-revalidate%2C+post-check%3D0%2C+pre-check%3D0'
         42        DO_ICALL                                                 
   34    43        INIT_FCALL                                               'header'
         44        SEND_VAL                                                 'Pragma%3A+public'
         45        DO_ICALL                                                 
   35    46        INIT_FCALL                                               'header'
         47        CONCAT                                           ~22     'Content-Length%3A+', !3
         48        SEND_VAL                                                 ~22
         49        DO_ICALL                                                 
   36    50        ECHO                                                     !1
   37    51      > RETURN                                                   null

End of function fetchfile

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.11 ms | 1407 KiB | 31 Q