3v4l.org

run code in 300+ PHP versions simultaneously
<?php $var = 'http://sandbox.case-store.ch/images/27-12-2014 13-50-47.png'; $var2 = 'sandbox.case-store.ch/images/27-12-2014 13-50-47.png'; function getImageContentRaw($url) { try { echo 'Stage0'; return file_get_contents($url); } catch (PHPException $ex) { // Ignore error and try http and https prefix } if (substr($url, 0, 7) === 'http://' || substr($url, 0, 7) === 'https://') { echo 'Stage9'; return false; } try { echo 'Stage1'; return file_get_contents(urlencode('https://'.$url)); } catch (PHPException $ex) { // Ignore error } try { echo 'Stage2'; return file_get_contents(urlencode('http://' . $url)); } catch (PHPException $ex) { // Ignore error } echo 'Stage8'; return false; } var_dump(getImageContentRaw($var)); var_dump(getImageContentRaw($var2));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RRBJR
function name:  (null)
number of ops:  15
compiled vars:  !0 = $var, !1 = $var2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'http%3A%2F%2Fsandbox.case-store.ch%2Fimages%2F27-12-2014+13-50-47.png'
    4     1        ASSIGN                                                   !1, 'sandbox.case-store.ch%2Fimages%2F27-12-2014+13-50-47.png'
   37     2        INIT_FCALL                                               'var_dump'
          3        INIT_FCALL                                               'getimagecontentraw'
          4        SEND_VAR                                                 !0
          5        DO_FCALL                                      0  $4      
          6        SEND_VAR                                                 $4
          7        DO_ICALL                                                 
   39     8        INIT_FCALL                                               'var_dump'
          9        INIT_FCALL                                               'getimagecontentraw'
         10        SEND_VAR                                                 !1
         11        DO_FCALL                                      0  $6      
         12        SEND_VAR                                                 $6
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Function getimagecontentraw:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 7
Branch analysis from position: 7
2 jumps found. (Code = 107) Position 1 = 8, Position 2 = -2
Branch analysis from position: 8
2 jumps found. (Code = 47) Position 1 = 15, Position 2 = 22
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 25
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
Found catch point at position: 35
Branch analysis from position: 35
2 jumps found. (Code = 107) Position 1 = 36, Position 2 = -2
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 46
Branch analysis from position: 46
2 jumps found. (Code = 107) Position 1 = 47, Position 2 = -2
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RRBJR
function name:  getImageContentRaw
number of ops:  50
compiled vars:  !0 = $url, !1 = $ex
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    8     1        ECHO                                                     'Stage0'
    9     2        INIT_FCALL                                               'file_get_contents'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $2      
          5      > RETURN                                                   $2
          6*       JMP                                                      ->8
   10     7  E > > CATCH                                       last         'PHPException'
   14     8    >   INIT_FCALL                                               'substr'
          9        SEND_VAR                                                 !0
         10        SEND_VAL                                                 0
         11        SEND_VAL                                                 7
         12        DO_ICALL                                         $3      
         13        IS_IDENTICAL                                     ~4      $3, 'http%3A%2F%2F'
         14      > JMPNZ_EX                                         ~4      ~4, ->22
         15    >   INIT_FCALL                                               'substr'
         16        SEND_VAR                                                 !0
         17        SEND_VAL                                                 0
         18        SEND_VAL                                                 7
         19        DO_ICALL                                         $5      
         20        IS_IDENTICAL                                     ~6      $5, 'https%3A%2F%2F'
         21        BOOL                                             ~4      ~6
         22    > > JMPZ                                                     ~4, ->25
   15    23    >   ECHO                                                     'Stage9'
   16    24      > RETURN                                                   <false>
   20    25    >   ECHO                                                     'Stage1'
   21    26        INIT_FCALL                                               'file_get_contents'
         27        INIT_FCALL                                               'urlencode'
         28        CONCAT                                           ~7      'https%3A%2F%2F', !0
         29        SEND_VAL                                                 ~7
         30        DO_ICALL                                         $8      
         31        SEND_VAR                                                 $8
         32        DO_ICALL                                         $9      
         33      > RETURN                                                   $9
         34*       JMP                                                      ->36
   22    35  E > > CATCH                                       last         'PHPException'
   27    36    >   ECHO                                                     'Stage2'
   28    37        INIT_FCALL                                               'file_get_contents'
         38        INIT_FCALL                                               'urlencode'
         39        CONCAT                                           ~10     'http%3A%2F%2F', !0
         40        SEND_VAL                                                 ~10
         41        DO_ICALL                                         $11     
         42        SEND_VAR                                                 $11
         43        DO_ICALL                                         $12     
         44      > RETURN                                                   $12
         45*       JMP                                                      ->47
   29    46  E > > CATCH                                       last         'PHPException'
   33    47    >   ECHO                                                     'Stage8'
   34    48      > RETURN                                                   <false>
   35    49*     > RETURN                                                   null

End of function getimagecontentraw

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.91 ms | 1407 KiB | 23 Q