3v4l.org

run code in 300+ PHP versions simultaneously
<?php function ranger($url){ $headers = array( "Range: bytes=0-32768" ); $curl = curl_init($url); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $data = curl_exec($curl); curl_close($curl); return $data; } $start = microtime(true); $url = "http://news.softpedia.com/images/news2/Debian-Turns-15-2.jpeg"; $raw = ranger($url); $im = imagecreatefromstring($raw); $width = imagesx($im); $height = imagesy($im); $stop = round(microtime(true) - $start, 5); echo $width." x ".$height." ({$stop}s)";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1hW3Q
function name:  (null)
number of ops:  38
compiled vars:  !0 = $start, !1 = $url, !2 = $raw, !3 = $im, !4 = $width, !5 = $height, !6 = $stop
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $7      
          3        ASSIGN                                                   !0, $7
   17     4        ASSIGN                                                   !1, 'http%3A%2F%2Fnews.softpedia.com%2Fimages%2Fnews2%2FDebian-Turns-15-2.jpeg'
   19     5        INIT_FCALL                                               'ranger'
          6        SEND_VAR                                                 !1
          7        DO_FCALL                                      0  $10     
          8        ASSIGN                                                   !2, $10
   20     9        INIT_FCALL_BY_NAME                                       'imagecreatefromstring'
         10        SEND_VAR_EX                                              !2
         11        DO_FCALL                                      0  $12     
         12        ASSIGN                                                   !3, $12
   22    13        INIT_FCALL_BY_NAME                                       'imagesx'
         14        SEND_VAR_EX                                              !3
         15        DO_FCALL                                      0  $14     
         16        ASSIGN                                                   !4, $14
   23    17        INIT_FCALL_BY_NAME                                       'imagesy'
         18        SEND_VAR_EX                                              !3
         19        DO_FCALL                                      0  $16     
         20        ASSIGN                                                   !5, $16
   25    21        INIT_FCALL                                               'round'
         22        INIT_FCALL                                               'microtime'
         23        SEND_VAL                                                 <true>
         24        DO_ICALL                                         $18     
         25        SUB                                              ~19     $18, !0
         26        SEND_VAL                                                 ~19
         27        SEND_VAL                                                 5
         28        DO_ICALL                                         $20     
         29        ASSIGN                                                   !6, $20
   27    30        CONCAT                                           ~22     !4, '+x+'
         31        CONCAT                                           ~23     ~22, !5
         32        ROPE_INIT                                     3  ~25     '+%28'
         33        ROPE_ADD                                      1  ~25     ~25, !6
         34        ROPE_END                                      2  ~24     ~25, 's%29'
         35        CONCAT                                           ~27     ~23, ~24
         36        ECHO                                                     ~27
         37      > RETURN                                                   1

Function ranger:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1hW3Q
function name:  ranger
number of ops:  27
compiled vars:  !0 = $url, !1 = $headers, !2 = $curl, !3 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        ASSIGN                                                   !1, <array>
    7     2        INIT_FCALL_BY_NAME                                       'curl_init'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0  $5      
          5        ASSIGN                                                   !2, $5
    8     6        INIT_FCALL_BY_NAME                                       'curl_setopt'
          7        SEND_VAR_EX                                              !2
          8        FETCH_CONSTANT                                   ~7      'CURLOPT_HTTPHEADER'
          9        SEND_VAL_EX                                              ~7
         10        SEND_VAR_EX                                              !1
         11        DO_FCALL                                      0          
    9    12        INIT_FCALL_BY_NAME                                       'curl_setopt'
         13        SEND_VAR_EX                                              !2
         14        FETCH_CONSTANT                                   ~9      'CURLOPT_RETURNTRANSFER'
         15        SEND_VAL_EX                                              ~9
         16        SEND_VAL_EX                                              1
         17        DO_FCALL                                      0          
   10    18        INIT_FCALL_BY_NAME                                       'curl_exec'
         19        SEND_VAR_EX                                              !2
         20        DO_FCALL                                      0  $11     
         21        ASSIGN                                                   !3, $11
   11    22        INIT_FCALL_BY_NAME                                       'curl_close'
         23        SEND_VAR_EX                                              !2
         24        DO_FCALL                                      0          
   12    25      > RETURN                                                   !3
   13    26*     > RETURN                                                   null

End of function ranger

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.09 ms | 1403 KiB | 18 Q