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(rawurlencode($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/f0AO2
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: 10
Branch analysis from position: 10
2 jumps found. (Code = 107) Position 1 = 11, Position 2 = -2
Branch analysis from position: 11
2 jumps found. (Code = 47) Position 1 = 18, Position 2 = 25
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 28
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
Found catch point at position: 38
Branch analysis from position: 38
2 jumps found. (Code = 107) Position 1 = 39, Position 2 = -2
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 49
Branch analysis from position: 49
2 jumps found. (Code = 107) Position 1 = 50, Position 2 = -2
Branch analysis from position: 50
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/f0AO2
function name:  getImageContentRaw
number of ops:  53
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        INIT_FCALL                                               'rawurlencode'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        SEND_VAR                                                 $2
          7        DO_ICALL                                         $3      
          8      > RETURN                                                   $3
          9*       JMP                                                      ->11
   10    10  E > > CATCH                                       last         'PHPException'
   14    11    >   INIT_FCALL                                               'substr'
         12        SEND_VAR                                                 !0
         13        SEND_VAL                                                 0
         14        SEND_VAL                                                 7
         15        DO_ICALL                                         $4      
         16        IS_IDENTICAL                                     ~5      $4, 'http%3A%2F%2F'
         17      > JMPNZ_EX                                         ~5      ~5, ->25
         18    >   INIT_FCALL                                               'substr'
         19        SEND_VAR                                                 !0
         20        SEND_VAL                                                 0
         21        SEND_VAL                                                 7
         22        DO_ICALL                                         $6      
         23        IS_IDENTICAL                                     ~7      $6, 'https%3A%2F%2F'
         24        BOOL                                             ~5      ~7
         25    > > JMPZ                                                     ~5, ->28
   15    26    >   ECHO                                                     'Stage9'
   16    27      > RETURN                                                   <false>
   20    28    >   ECHO                                                     'Stage1'
   21    29        INIT_FCALL                                               'file_get_contents'
         30        INIT_FCALL                                               'urlencode'
         31        CONCAT                                           ~8      'https%3A%2F%2F', !0
         32        SEND_VAL                                                 ~8
         33        DO_ICALL                                         $9      
         34        SEND_VAR                                                 $9
         35        DO_ICALL                                         $10     
         36      > RETURN                                                   $10
         37*       JMP                                                      ->39
   22    38  E > > CATCH                                       last         'PHPException'
   27    39    >   ECHO                                                     'Stage2'
   28    40        INIT_FCALL                                               'file_get_contents'
         41        INIT_FCALL                                               'urlencode'
         42        CONCAT                                           ~11     'http%3A%2F%2F', !0
         43        SEND_VAL                                                 ~11
         44        DO_ICALL                                         $12     
         45        SEND_VAR                                                 $12
         46        DO_ICALL                                         $13     
         47      > RETURN                                                   $13
         48*       JMP                                                      ->50
   29    49  E > > CATCH                                       last         'PHPException'
   33    50    >   ECHO                                                     'Stage8'
   34    51      > RETURN                                                   <false>
   35    52*     > RETURN                                                   null

End of function getimagecontentraw

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.33 ms | 1403 KiB | 25 Q