3v4l.org

run code in 300+ PHP versions simultaneously
<?php header ("Content-type: image/png"); $string = DigitalPortfolio; $font = 15; $width = 300; $height = 350; $image = imagecreate($width, $height); $back = ImageColorAllocate($image, 255, 255, 255); $border = ImageColorAllocate($image, 0, 0, 0); ImageFilledRectangle($image, 0, 0, $width, $height, $border); ImageFilledRectangle($image, 1, 1, $width-2, $height-2, $back); $text_color = imagecolorallocate($image, 255, 0, 0); ImageStringWrap($image, $font, 3, 2, $string, $text_color, $width-2 ); imagepng($image); function ImageStringWrap($image, $font, $x, $y, $text, $color, $maxwidth) { $fontwidth = ImageFontWidth($font); $fontheight = ImageFontHeight($font); if ($maxwidth != NULL) { $maxcharsperline = floor($maxwidth / $fontwidth); $text = wordwrap($text, $maxcharsperline, "\n", false); } while (list($numl, $line) = each($lines)) { ImageString($image, $font, $x, $y, $line, $color); $y += $fontheight; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2RMLL
function name:  (null)
number of ops:  66
compiled vars:  !0 = $string, !1 = $font, !2 = $width, !3 = $height, !4 = $image, !5 = $back, !6 = $border, !7 = $text_color
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'header'
          1        SEND_VAL                                                 'Content-type%3A+image%2Fpng'
          2        DO_ICALL                                                 
    5     3        FETCH_CONSTANT                                   ~9      'DigitalPortfolio'
          4        ASSIGN                                                   !0, ~9
    6     5        ASSIGN                                                   !1, 15
    8     6        ASSIGN                                                   !2, 300
    9     7        ASSIGN                                                   !3, 350
   10     8        INIT_FCALL_BY_NAME                                       'imagecreate'
          9        SEND_VAR_EX                                              !2
         10        SEND_VAR_EX                                              !3
         11        DO_FCALL                                      0  $14     
         12        ASSIGN                                                   !4, $14
   12    13        INIT_FCALL_BY_NAME                                       'ImageColorAllocate'
         14        SEND_VAR_EX                                              !4
         15        SEND_VAL_EX                                              255
         16        SEND_VAL_EX                                              255
         17        SEND_VAL_EX                                              255
         18        DO_FCALL                                      0  $16     
         19        ASSIGN                                                   !5, $16
   13    20        INIT_FCALL_BY_NAME                                       'ImageColorAllocate'
         21        SEND_VAR_EX                                              !4
         22        SEND_VAL_EX                                              0
         23        SEND_VAL_EX                                              0
         24        SEND_VAL_EX                                              0
         25        DO_FCALL                                      0  $18     
         26        ASSIGN                                                   !6, $18
   15    27        INIT_FCALL_BY_NAME                                       'ImageFilledRectangle'
         28        SEND_VAR_EX                                              !4
         29        SEND_VAL_EX                                              0
         30        SEND_VAL_EX                                              0
         31        SEND_VAR_EX                                              !2
         32        SEND_VAR_EX                                              !3
         33        SEND_VAR_EX                                              !6
         34        DO_FCALL                                      0          
   16    35        INIT_FCALL_BY_NAME                                       'ImageFilledRectangle'
         36        SEND_VAR_EX                                              !4
         37        SEND_VAL_EX                                              1
         38        SEND_VAL_EX                                              1
         39        SUB                                              ~21     !2, 2
         40        SEND_VAL_EX                                              ~21
         41        SUB                                              ~22     !3, 2
         42        SEND_VAL_EX                                              ~22
         43        SEND_VAR_EX                                              !5
         44        DO_FCALL                                      0          
   18    45        INIT_FCALL_BY_NAME                                       'imagecolorallocate'
         46        SEND_VAR_EX                                              !4
         47        SEND_VAL_EX                                              255
         48        SEND_VAL_EX                                              0
         49        SEND_VAL_EX                                              0
         50        DO_FCALL                                      0  $24     
         51        ASSIGN                                                   !7, $24
   20    52        INIT_FCALL_BY_NAME                                       'ImageStringWrap'
         53        SEND_VAR_EX                                              !4
         54        SEND_VAR_EX                                              !1
         55        SEND_VAL_EX                                              3
         56        SEND_VAL_EX                                              2
         57        SEND_VAR_EX                                              !0
         58        SEND_VAR_EX                                              !7
         59        SUB                                              ~26     !2, 2
         60        SEND_VAL_EX                                              ~26
         61        DO_FCALL                                      0          
   22    62        INIT_FCALL_BY_NAME                                       'imagepng'
         63        SEND_VAR_EX                                              !4
         64        DO_FCALL                                      0          
   37    65      > RETURN                                                   1

Function imagestringwrap:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 29
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
2 jumps found. (Code = 44) Position 1 = 47, Position 2 = 30
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 47, Position 2 = 30
Branch analysis from position: 47
Branch analysis from position: 30
Branch analysis from position: 29
filename:       /in/2RMLL
function name:  ImageStringWrap
number of ops:  48
compiled vars:  !0 = $image, !1 = $font, !2 = $x, !3 = $y, !4 = $text, !5 = $color, !6 = $maxwidth, !7 = $fontwidth, !8 = $fontheight, !9 = $maxcharsperline, !10 = $line, !11 = $lines, !12 = $numl
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
          4        RECV                                             !4      
          5        RECV                                             !5      
          6        RECV                                             !6      
   25     7        INIT_FCALL_BY_NAME                                       'ImageFontWidth'
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0  $13     
         10        ASSIGN                                                   !7, $13
   26    11        INIT_FCALL_BY_NAME                                       'ImageFontHeight'
         12        SEND_VAR_EX                                              !1
         13        DO_FCALL                                      0  $15     
         14        ASSIGN                                                   !8, $15
   28    15        IS_NOT_EQUAL                                             !6, null
         16      > JMPZ                                                     ~17, ->29
   29    17    >   INIT_FCALL                                               'floor'
         18        DIV                                              ~18     !6, !7
         19        SEND_VAL                                                 ~18
         20        DO_ICALL                                         $19     
         21        ASSIGN                                                   !9, $19
   30    22        INIT_FCALL                                               'wordwrap'
         23        SEND_VAR                                                 !4
         24        SEND_VAR                                                 !9
         25        SEND_VAL                                                 '%0A'
         26        SEND_VAL                                                 <false>
         27        DO_ICALL                                         $21     
         28        ASSIGN                                                   !4, $21
   33    29    > > JMP                                                      ->39
   34    30    >   INIT_FCALL_BY_NAME                                       'ImageString'
         31        SEND_VAR_EX                                              !0
         32        SEND_VAR_EX                                              !1
         33        SEND_VAR_EX                                              !2
         34        SEND_VAR_EX                                              !3
         35        SEND_VAR_EX                                              !10
         36        SEND_VAR_EX                                              !5
         37        DO_FCALL                                      0          
   35    38        ASSIGN_OP                                     1          !3, !8
   33    39    >   INIT_FCALL_BY_NAME                                       'each'
         40        SEND_VAR_EX                                              !11
         41        DO_FCALL                                      0  $25     
         42        FETCH_LIST_R                                     $26     $25, 0
         43        ASSIGN                                                   !12, $26
         44        FETCH_LIST_R                                     $28     $25, 1
         45        ASSIGN                                                   !10, $28
         46      > JMPNZ                                                    $25, ->30
   37    47    > > RETURN                                                   null

End of function imagestringwrap

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.5 ms | 1408 KiB | 19 Q