3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getext($filename) { $pos = strrpos($filename,'.'); $str = substr($filename, $pos); return $str; } $image = 'http://webplatformtools.org/images/app/logo.png'; $ext = getext($image); if($ext == ".jpg"){ $img = ImageCreateFromJpeg($image); } else{ echo'Wrong File Type'; } $width = imagesx($img); $height = imagesy($img); for($h=0;$h<$height;$h++){ for($w=0;$w<=$width;$w++){ $rgb = ImageColorAt($img, $w, $h); $r = ($rgb >> 16) & 0xFF; $g = ($rgb >> 8) & 0xFF; $b = $rgb & 0xFF; if($w == $width){ echo '<br>'; }else{ echo '<span style="color:rgb('.$r.','.$g.','.$b.');">#</span>'; } } } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 54
Branch analysis from position: 54
2 jumps found. (Code = 44) Position 1 = 56, Position 2 = 23
Branch analysis from position: 56
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 51
Branch analysis from position: 51
2 jumps found. (Code = 44) Position 1 = 53, Position 2 = 25
Branch analysis from position: 53
2 jumps found. (Code = 44) Position 1 = 56, Position 2 = 23
Branch analysis from position: 56
Branch analysis from position: 23
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 41, Position 2 = 43
Branch analysis from position: 41
1 jumps found. (Code = 42) Position 1 = 50
Branch analysis from position: 50
2 jumps found. (Code = 44) Position 1 = 53, Position 2 = 25
Branch analysis from position: 53
Branch analysis from position: 25
Branch analysis from position: 43
2 jumps found. (Code = 44) Position 1 = 53, Position 2 = 25
Branch analysis from position: 53
Branch analysis from position: 25
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 54
Branch analysis from position: 54
filename:       /in/Fgt2l
function name:  (null)
number of ops:  57
compiled vars:  !0 = $image, !1 = $ext, !2 = $img, !3 = $width, !4 = $height, !5 = $h, !6 = $w, !7 = $rgb, !8 = $r, !9 = $g, !10 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, 'http%3A%2F%2Fwebplatformtools.org%2Fimages%2Fapp%2Flogo.png'
    8     1        INIT_FCALL                                               'getext'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $12     
          4        ASSIGN                                                   !1, $12
    9     5        IS_EQUAL                                                 !1, '.jpg'
          6      > JMPZ                                                     ~14, ->12
   10     7    >   INIT_FCALL_BY_NAME                                       'ImageCreateFromJpeg'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0  $15     
         10        ASSIGN                                                   !2, $15
         11      > JMP                                                      ->13
   13    12    >   ECHO                                                     'Wrong+File+Type'
   15    13    >   INIT_FCALL_BY_NAME                                       'imagesx'
         14        SEND_VAR_EX                                              !2
         15        DO_FCALL                                      0  $17     
         16        ASSIGN                                                   !3, $17
   16    17        INIT_FCALL_BY_NAME                                       'imagesy'
         18        SEND_VAR_EX                                              !2
         19        DO_FCALL                                      0  $19     
         20        ASSIGN                                                   !4, $19
   18    21        ASSIGN                                                   !5, 0
         22      > JMP                                                      ->54
   19    23    >   ASSIGN                                                   !6, 0
         24      > JMP                                                      ->51
   20    25    >   INIT_FCALL_BY_NAME                                       'ImageColorAt'
         26        SEND_VAR_EX                                              !2
         27        SEND_VAR_EX                                              !6
         28        SEND_VAR_EX                                              !5
         29        DO_FCALL                                      0  $23     
         30        ASSIGN                                                   !7, $23
   21    31        SR                                               ~25     !7, 16
         32        BW_AND                                           ~26     ~25, 255
         33        ASSIGN                                                   !8, ~26
   22    34        SR                                               ~28     !7, 8
         35        BW_AND                                           ~29     ~28, 255
         36        ASSIGN                                                   !9, ~29
   23    37        BW_AND                                           ~31     !7, 255
         38        ASSIGN                                                   !10, ~31
   24    39        IS_EQUAL                                                 !6, !3
         40      > JMPZ                                                     ~33, ->43
   25    41    >   ECHO                                                     '%3Cbr%3E'
         42      > JMP                                                      ->50
   27    43    >   CONCAT                                           ~34     '%3Cspan+style%3D%22color%3Argb%28', !8
         44        CONCAT                                           ~35     ~34, '%2C'
         45        CONCAT                                           ~36     ~35, !9
         46        CONCAT                                           ~37     ~36, '%2C'
         47        CONCAT                                           ~38     ~37, !10
         48        CONCAT                                           ~39     ~38, '%29%3B%22%3E%23%3C%2Fspan%3E'
         49        ECHO                                                     ~39
   19    50    >   PRE_INC                                                  !6
         51    >   IS_SMALLER_OR_EQUAL                                      !6, !3
         52      > JMPNZ                                                    ~41, ->25
   18    53    >   PRE_INC                                                  !5
         54    >   IS_SMALLER                                               !5, !4
         55      > JMPNZ                                                    ~43, ->23
   31    56    > > RETURN                                                   1

Function getext:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Fgt2l
function name:  getext
number of ops:  13
compiled vars:  !0 = $filename, !1 = $pos, !2 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        INIT_FCALL                                               'strrpos'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '.'
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !1, $3
    4     6        INIT_FCALL                                               'substr'
          7        SEND_VAR                                                 !0
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                         $5      
         10        ASSIGN                                                   !2, $5
    5    11      > RETURN                                                   !2
    6    12*     > RETURN                                                   null

End of function getext

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.25 ms | 1403 KiB | 18 Q