3v4l.org

run code in 300+ PHP versions simultaneously
<?php function generatecaptcha(){ $randomcontent = str_split('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789'); $content = null; for($i=0; $i<5; $i++){ $content = $content.$randomcontent[rand(0,60)]; } $image = ImageCreate(46, 17);//width and height imagecolorallocate($image, 0, 0, 0);//get background color for image image, r, g, b $font_color = imagecolorallocate($image, 255, 255, 255); imagestring($image, 10, 0, 0, $content, $font_color);//convert string to image-- image, font-size, x,y, string, font-color return imagejpeg($image); } generatecaptcha(); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BoH6h
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'generatecaptcha'
          1        DO_FCALL                                      0          
   15     2      > RETURN                                                   1

Function generatecaptcha:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 7
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 7
Branch analysis from position: 17
Branch analysis from position: 7
filename:       /in/BoH6h
function name:  generatecaptcha
number of ops:  48
compiled vars:  !0 = $randomcontent, !1 = $content, !2 = $i, !3 = $image, !4 = $font_color
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'str_split'
          1        SEND_VAL                                                 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789'
          2        DO_ICALL                                         $5      
          3        ASSIGN                                                   !0, $5
    3     4        ASSIGN                                                   !1, null
    4     5        ASSIGN                                                   !2, 0
          6      > JMP                                                      ->15
    5     7    >   INIT_FCALL                                               'rand'
          8        SEND_VAL                                                 0
          9        SEND_VAL                                                 60
         10        DO_ICALL                                         $9      
         11        FETCH_DIM_R                                      ~10     !0, $9
         12        CONCAT                                           ~11     !1, ~10
         13        ASSIGN                                                   !1, ~11
    4    14        PRE_INC                                                  !2
         15    >   IS_SMALLER                                               !2, 5
         16      > JMPNZ                                                    ~14, ->7
    7    17    >   INIT_FCALL_BY_NAME                                       'ImageCreate'
         18        SEND_VAL_EX                                              46
         19        SEND_VAL_EX                                              17
         20        DO_FCALL                                      0  $15     
         21        ASSIGN                                                   !3, $15
    8    22        INIT_FCALL_BY_NAME                                       'imagecolorallocate'
         23        SEND_VAR_EX                                              !3
         24        SEND_VAL_EX                                              0
         25        SEND_VAL_EX                                              0
         26        SEND_VAL_EX                                              0
         27        DO_FCALL                                      0          
    9    28        INIT_FCALL_BY_NAME                                       'imagecolorallocate'
         29        SEND_VAR_EX                                              !3
         30        SEND_VAL_EX                                              255
         31        SEND_VAL_EX                                              255
         32        SEND_VAL_EX                                              255
         33        DO_FCALL                                      0  $18     
         34        ASSIGN                                                   !4, $18
   10    35        INIT_FCALL_BY_NAME                                       'imagestring'
         36        SEND_VAR_EX                                              !3
         37        SEND_VAL_EX                                              10
         38        SEND_VAL_EX                                              0
         39        SEND_VAL_EX                                              0
         40        SEND_VAR_EX                                              !1
         41        SEND_VAR_EX                                              !4
         42        DO_FCALL                                      0          
   11    43        INIT_FCALL_BY_NAME                                       'imagejpeg'
         44        SEND_VAR_EX                                              !3
         45        DO_FCALL                                      0  $21     
         46      > RETURN                                                   $21
   12    47*     > RETURN                                                   null

End of function generatecaptcha

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
189.55 ms | 1403 KiB | 18 Q