3v4l.org

run code in 300+ PHP versions simultaneously
<?php //---------------------------------------------------------------------------------------- // Script: // online-thumb.php // // Remark: // This sample script shows how to make a web thumbnail in the memory and // output to client browser. // // Parameters: // url: The URL of HTML page that you want to convert. the default URL is // http://www.google.com // width: The thumbnail image width. The default value is 320. // height: The thumbnail image height. The defaul value is 240. // ratiotype: The width/height ratio type. 0: keep ratio by width; 1: keep ratio by height. // The default is 0. // // Example: // <img src="online-thumb.php"> or // <img src="online-thumb.php?url=http://www.google.com"> or // <img src="online-thumb.php?url=http://www.google.com&width=320&height=240&ratiotype=0"> //---------------------------------------------------------------------------------------- // Create instance ACAWebThumb.ThumbMaker $HTML_Converter = new COM("ACAWebThumb.ThumbMaker") or die ("Create ACAWebThumb.ThumbMaker failed. Please make sure the component has been installed."); // Get the parameters $t_strURL = isset($_GET["url"]) ? $_GET["url"] : "http://www.google.com"; $t_iWidth = isset($_GET["width"]) ? $_GET["width"] : 320; $t_iHeight = isset($_GET["height"]) ? $_GET["height"] : 240; $t_iRatioType = isset($_GET["ratiotype"]) ? $_GET["ratiotype"] : 0; // Set the URL and start the snap job. $HTML_Converter->SetURL($t_strURL); if ( 0 == $HTML_Converter->StartSnap() ) { // snap successful, set the thumbnail size and get image bytes $HTML_Converter->SetThumbSize ($t_iWidth, $t_iHeight, $t_iRatioType); //get image bytes by PNG format $t_arrThumbImageBytes = $HTML_Converter->GetImageBytes ("png"); // output the image bytes to client browser if ( count($t_arrThumbImageBytes) > 0 ) { // set the output header as PNG image, then output the thumbnail image bytes. header("Content-type: image/png"); foreach($t_arrThumbImageBytes as $byte) echo chr($byte); } } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 14
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 23
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 32
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
2 jumps found. (Code = 43) Position 1 = 37, Position 2 = 41
Branch analysis from position: 37
1 jumps found. (Code = 42) Position 1 = 42
Branch analysis from position: 42
2 jumps found. (Code = 43) Position 1 = 50, Position 2 = 73
Branch analysis from position: 50
2 jumps found. (Code = 43) Position 1 = 62, Position 2 = 73
Branch analysis from position: 62
2 jumps found. (Code = 77) Position 1 = 66, Position 2 = 72
Branch analysis from position: 66
2 jumps found. (Code = 78) Position 1 = 67, Position 2 = 72
Branch analysis from position: 67
1 jumps found. (Code = 42) Position 1 = 66
Branch analysis from position: 66
Branch analysis from position: 72
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 72
Branch analysis from position: 73
Branch analysis from position: 73
Branch analysis from position: 41
2 jumps found. (Code = 43) Position 1 = 50, Position 2 = 73
Branch analysis from position: 50
Branch analysis from position: 73
Branch analysis from position: 32
2 jumps found. (Code = 43) Position 1 = 37, Position 2 = 41
Branch analysis from position: 37
Branch analysis from position: 41
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 32
Branch analysis from position: 28
Branch analysis from position: 32
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 23
Branch analysis from position: 19
Branch analysis from position: 23
filename:       /in/iesNl
function name:  (null)
number of ops:  74
compiled vars:  !0 = $HTML_Converter, !1 = $t_strURL, !2 = $t_iWidth, !3 = $t_iHeight, !4 = $t_iRatioType, !5 = $t_arrThumbImageBytes, !6 = $byte
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   NEW                                              $7      'COM'
          1        SEND_VAL_EX                                              'ACAWebThumb.ThumbMaker'
          2        DO_FCALL                                      0          
          3        ASSIGN                                           ~9      !0, $7
          4      > JMPNZ_EX                                         ~9      ~9, ->7
   26     5    > > EXIT                                                     'Create+ACAWebThumb.ThumbMaker+failed.+Please+make+sure+the+component+has+been+installed.'
          6*       BOOL                                             ~9      <true>
   29     7    >   FETCH_IS                                         ~10     '_GET'
          8        ISSET_ISEMPTY_DIM_OBJ                         0          ~10, 'url'
          9      > JMPZ                                                     ~11, ->14
         10    >   FETCH_R                      global              ~12     '_GET'
         11        FETCH_DIM_R                                      ~13     ~12, 'url'
         12        QM_ASSIGN                                        ~14     ~13
         13      > JMP                                                      ->15
         14    >   QM_ASSIGN                                        ~14     'http%3A%2F%2Fwww.google.com'
         15    >   ASSIGN                                                   !1, ~14
   30    16        FETCH_IS                                         ~16     '_GET'
         17        ISSET_ISEMPTY_DIM_OBJ                         0          ~16, 'width'
         18      > JMPZ                                                     ~17, ->23
         19    >   FETCH_R                      global              ~18     '_GET'
         20        FETCH_DIM_R                                      ~19     ~18, 'width'
         21        QM_ASSIGN                                        ~20     ~19
         22      > JMP                                                      ->24
         23    >   QM_ASSIGN                                        ~20     320
         24    >   ASSIGN                                                   !2, ~20
   31    25        FETCH_IS                                         ~22     '_GET'
         26        ISSET_ISEMPTY_DIM_OBJ                         0          ~22, 'height'
         27      > JMPZ                                                     ~23, ->32
         28    >   FETCH_R                      global              ~24     '_GET'
         29        FETCH_DIM_R                                      ~25     ~24, 'height'
         30        QM_ASSIGN                                        ~26     ~25
         31      > JMP                                                      ->33
         32    >   QM_ASSIGN                                        ~26     240
         33    >   ASSIGN                                                   !3, ~26
   32    34        FETCH_IS                                         ~28     '_GET'
         35        ISSET_ISEMPTY_DIM_OBJ                         0          ~28, 'ratiotype'
         36      > JMPZ                                                     ~29, ->41
         37    >   FETCH_R                      global              ~30     '_GET'
         38        FETCH_DIM_R                                      ~31     ~30, 'ratiotype'
         39        QM_ASSIGN                                        ~32     ~31
         40      > JMP                                                      ->42
         41    >   QM_ASSIGN                                        ~32     0
         42    >   ASSIGN                                                   !4, ~32
   35    43        INIT_METHOD_CALL                                         !0, 'SetURL'
         44        SEND_VAR_EX                                              !1
         45        DO_FCALL                                      0          
   36    46        INIT_METHOD_CALL                                         !0, 'StartSnap'
         47        DO_FCALL                                      0  $35     
         48        IS_EQUAL                                                 $35, 0
         49      > JMPZ                                                     ~36, ->73
   39    50    >   INIT_METHOD_CALL                                         !0, 'SetThumbSize'
         51        SEND_VAR_EX                                              !2
         52        SEND_VAR_EX                                              !3
         53        SEND_VAR_EX                                              !4
         54        DO_FCALL                                      0          
   41    55        INIT_METHOD_CALL                                         !0, 'GetImageBytes'
         56        SEND_VAL_EX                                              'png'
         57        DO_FCALL                                      0  $38     
         58        ASSIGN                                                   !5, $38
   43    59        COUNT                                            ~40     !5
         60        IS_SMALLER                                               0, ~40
         61      > JMPZ                                                     ~41, ->73
   46    62    >   INIT_FCALL                                               'header'
         63        SEND_VAL                                                 'Content-type%3A+image%2Fpng'
         64        DO_ICALL                                                 
   47    65      > FE_RESET_R                                       $43     !5, ->72
         66    > > FE_FETCH_R                                               $43, !6, ->72
   48    67    >   INIT_FCALL                                               'chr'
         68        SEND_VAR                                                 !6
         69        DO_ICALL                                         $44     
         70        ECHO                                                     $44
   47    71      > JMP                                                      ->66
         72    >   FE_FREE                                                  $43
   51    73    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.97 ms | 1404 KiB | 17 Q