3v4l.org

run code in 300+ PHP versions simultaneously
<?php header('Content-Type: image/png'); session_start(); //Initialising floor plan generation variables $vertxstart = 70; $vertystart = 70; $vertwidth = 31; $vertheight = 140; $horzwidth = 140; $horzheight = 31; $horzxstart = 970; $horzystart = 60; $rmodind = 8; $lmodind = 23; $moddrawsize = 8; $modgap = 15; $vertxincr = 60; $vertyincr = 169; $horzyincr = 60; $row = 1; $column = 1; $splitter = 1; //Initialising database connections for later use $user_name = "shoppin1_root"; $password = "ryan062098!"; $server = "localhost"; $database = "shoppin1_shop"; $db_handle = mysql_connect($server, $user_name, $password); $db_found = mysql_select_db($database, $db_handle); //Initialising image draw space $canvas = imagecreate(1200, 400); //Allocate colours $black = imagecolorallocate($canvas, 0, 0, 0); $white = imagecolorallocate($canvas, 255, 255, 255); $silver = imagecolorallocate($canvas, 192, 192, 192); $green = imagecolorallocate($canvas, 172, 250, 88); $blue = imagecolorallocate($canvas, 88, 211, 247); $red = imagecolorallocate($canvas, 250, 88, 88); //Fix implemented so image is transparent, so html background is shown in places not drawn imagefilltoborder($canvas, 0, 0, $silver, $silver); imagecolortransparent($canvas, $silver); //Draws vertical aisles on floor plan for ($row; $row < 3; $row++) { for ($column; $column < 15; $column++) { if ($row == 2 and ($column == 11 or $column == 12)) { //exception in algorithm to allow for clothes section } else { imagerectangle($canvas, $vertxstart, $vertystart, ($vertxstart + $vertwidth), ($vertystart + $vertheight), $black); imagerectangle($canvas, ($vertxstart + $rmodind), $vertystart, ($vertxstart + $rmodind + $modgap), ($vertystart + $vertheight), $black); imagerectangle($canvas, ($vertxstart + 3), ($vertystart + $vertheight), ($vertxstart + 28), ($vertystart + $vertheight + 8), $black); imagerectangle($canvas, ($vertxstart + 3), ($vertystart - 8), ($vertxstart + 28), $vertystart, $black); if ($row == 2) { $aislenumber = 15 - $column; //Moves aislenumber to bottom row of aisles } else { $aislenumber = 14 + $column; //Top row of aisles } $SQL = "SELECT rmods, lmods FROM isleinfo WHERE islenumber = '$aislenumber'"; $Result = mysql_query($SQL); while ($field = mysql_fetch_array($result)) { $rmods = $field['rmods']; $lmods = $field['lmods']; } mysql_close($db_handle); if ($aislenumber !== 1 and $aislenumber !== 28) { //exception for aisle 1 and 28 as right mods do not need to be drawn, main aisle is to the right $modsize = 200 / $rmods; for ($splitter; $splitter < $rmods; $splitter++) { imageline($canvas, $vertxstart, ($vertystart + ($modsize * $splitter) - 1), ($vertxstart + 8), ($vertystart + ($modsize * $splitter) - 1)); } } if ($aislenumber !== 14 and $aislenumber !== 15) { //exception for aisle 14 and 15 as left mods do not need to be drawn, back wall is to the left $modsize = 200 / $lmods; //Gets draw size of individual mod for ($splitter; $splitter < $lmods; $splitter++) { //draws lines to seperate mods visually on screen at correct co-ordinates imageline($canvas, ($vertxstart - 37), ($vertystart + ($modsize * $splitter) - 1), ($vertxstart - 29), ($vertystart + ($modsize * $splitter) - 1)); } } } $vertxstart = $vertxstart + $vertxincr; //Move to next aisle co-ordinates } $vertystart = $vertystart + $vertyincr; //Move to bottom row aisles } //Output and free from memory imagepng($canvas); imagedestroy($canvas); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 240
Branch analysis from position: 240
2 jumps found. (Code = 44) Position 1 = 242, Position 2 = 97
Branch analysis from position: 242
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 97
1 jumps found. (Code = 42) Position 1 = 235
Branch analysis from position: 235
2 jumps found. (Code = 44) Position 1 = 237, Position 2 = 98
Branch analysis from position: 237
2 jumps found. (Code = 44) Position 1 = 242, Position 2 = 97
Branch analysis from position: 242
Branch analysis from position: 97
Branch analysis from position: 98
2 jumps found. (Code = 46) Position 1 = 100, Position 2 = 105
Branch analysis from position: 100
2 jumps found. (Code = 47) Position 1 = 102, Position 2 = 104
Branch analysis from position: 102
2 jumps found. (Code = 43) Position 1 = 106, Position 2 = 107
Branch analysis from position: 106
1 jumps found. (Code = 42) Position 1 = 232
Branch analysis from position: 232
2 jumps found. (Code = 44) Position 1 = 237, Position 2 = 98
Branch analysis from position: 237
Branch analysis from position: 98
Branch analysis from position: 107
2 jumps found. (Code = 43) Position 1 = 155, Position 2 = 158
Branch analysis from position: 155
1 jumps found. (Code = 42) Position 1 = 160
Branch analysis from position: 160
1 jumps found. (Code = 42) Position 1 = 173
Branch analysis from position: 173
2 jumps found. (Code = 44) Position 1 = 178, Position 2 = 169
Branch analysis from position: 178
2 jumps found. (Code = 46) Position 1 = 183, Position 2 = 185
Branch analysis from position: 183
2 jumps found. (Code = 43) Position 1 = 186, Position 2 = 206
Branch analysis from position: 186
1 jumps found. (Code = 42) Position 1 = 204
Branch analysis from position: 204
2 jumps found. (Code = 44) Position 1 = 206, Position 2 = 189
Branch analysis from position: 206
2 jumps found. (Code = 46) Position 1 = 208, Position 2 = 210
Branch analysis from position: 208
2 jumps found. (Code = 43) Position 1 = 211, Position 2 = 232
Branch analysis from position: 211
1 jumps found. (Code = 42) Position 1 = 230
Branch analysis from position: 230
2 jumps found. (Code = 44) Position 1 = 232, Position 2 = 214
Branch analysis from position: 232
Branch analysis from position: 214
2 jumps found. (Code = 44) Position 1 = 232, Position 2 = 214
Branch analysis from position: 232
Branch analysis from position: 214
Branch analysis from position: 232
Branch analysis from position: 210
Branch analysis from position: 189
2 jumps found. (Code = 44) Position 1 = 206, Position 2 = 189
Branch analysis from position: 206
Branch analysis from position: 189
Branch analysis from position: 206
Branch analysis from position: 185
Branch analysis from position: 169
2 jumps found. (Code = 44) Position 1 = 178, Position 2 = 169
Branch analysis from position: 178
Branch analysis from position: 169
Branch analysis from position: 158
1 jumps found. (Code = 42) Position 1 = 173
Branch analysis from position: 173
Branch analysis from position: 104
Branch analysis from position: 105
filename:       /in/HSQXL
function name:  (null)
number of ops:  249
compiled vars:  !0 = $vertxstart, !1 = $vertystart, !2 = $vertwidth, !3 = $vertheight, !4 = $horzwidth, !5 = $horzheight, !6 = $horzxstart, !7 = $horzystart, !8 = $rmodind, !9 = $lmodind, !10 = $moddrawsize, !11 = $modgap, !12 = $vertxincr, !13 = $vertyincr, !14 = $horzyincr, !15 = $row, !16 = $column, !17 = $splitter, !18 = $user_name, !19 = $password, !20 = $server, !21 = $database, !22 = $db_handle, !23 = $db_found, !24 = $canvas, !25 = $black, !26 = $white, !27 = $silver, !28 = $green, !29 = $blue, !30 = $red, !31 = $aislenumber, !32 = $SQL, !33 = $Result, !34 = $rmods, !35 = $field, !36 = $lmods, !37 = $result, !38 = $modsize
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'header'
          1        SEND_VAL                                                 'Content-Type%3A+image%2Fpng'
          2        DO_ICALL                                                 
    3     3        INIT_FCALL                                               'session_start'
          4        DO_ICALL                                                 
    6     5        ASSIGN                                                   !0, 70
    7     6        ASSIGN                                                   !1, 70
    8     7        ASSIGN                                                   !2, 31
    9     8        ASSIGN                                                   !3, 140
   10     9        ASSIGN                                                   !4, 140
   11    10        ASSIGN                                                   !5, 31
   12    11        ASSIGN                                                   !6, 970
   13    12        ASSIGN                                                   !7, 60
   14    13        ASSIGN                                                   !8, 8
   15    14        ASSIGN                                                   !9, 23
   16    15        ASSIGN                                                   !10, 8
   17    16        ASSIGN                                                   !11, 15
   18    17        ASSIGN                                                   !12, 60
   19    18        ASSIGN                                                   !13, 169
   20    19        ASSIGN                                                   !14, 60
   21    20        ASSIGN                                                   !15, 1
   22    21        ASSIGN                                                   !16, 1
   23    22        ASSIGN                                                   !17, 1
   26    23        ASSIGN                                                   !18, 'shoppin1_root'
   27    24        ASSIGN                                                   !19, 'ryan062098%21'
   28    25        ASSIGN                                                   !20, 'localhost'
   29    26        ASSIGN                                                   !21, 'shoppin1_shop'
   30    27        INIT_FCALL_BY_NAME                                       'mysql_connect'
         28        SEND_VAR_EX                                              !20
         29        SEND_VAR_EX                                              !18
         30        SEND_VAR_EX                                              !19
         31        DO_FCALL                                      0  $63     
         32        ASSIGN                                                   !22, $63
   31    33        INIT_FCALL_BY_NAME                                       'mysql_select_db'
         34        SEND_VAR_EX                                              !21
         35        SEND_VAR_EX                                              !22
         36        DO_FCALL                                      0  $65     
         37        ASSIGN                                                   !23, $65
   34    38        INIT_FCALL_BY_NAME                                       'imagecreate'
         39        SEND_VAL_EX                                              1200
         40        SEND_VAL_EX                                              400
         41        DO_FCALL                                      0  $67     
         42        ASSIGN                                                   !24, $67
   36    43        INIT_FCALL_BY_NAME                                       'imagecolorallocate'
         44        SEND_VAR_EX                                              !24
         45        SEND_VAL_EX                                              0
         46        SEND_VAL_EX                                              0
         47        SEND_VAL_EX                                              0
         48        DO_FCALL                                      0  $69     
         49        ASSIGN                                                   !25, $69
   37    50        INIT_FCALL_BY_NAME                                       'imagecolorallocate'
         51        SEND_VAR_EX                                              !24
         52        SEND_VAL_EX                                              255
         53        SEND_VAL_EX                                              255
         54        SEND_VAL_EX                                              255
         55        DO_FCALL                                      0  $71     
         56        ASSIGN                                                   !26, $71
   38    57        INIT_FCALL_BY_NAME                                       'imagecolorallocate'
         58        SEND_VAR_EX                                              !24
         59        SEND_VAL_EX                                              192
         60        SEND_VAL_EX                                              192
         61        SEND_VAL_EX                                              192
         62        DO_FCALL                                      0  $73     
         63        ASSIGN                                                   !27, $73
   39    64        INIT_FCALL_BY_NAME                                       'imagecolorallocate'
         65        SEND_VAR_EX                                              !24
         66        SEND_VAL_EX                                              172
         67        SEND_VAL_EX                                              250
         68        SEND_VAL_EX                                              88
         69        DO_FCALL                                      0  $75     
         70        ASSIGN                                                   !28, $75
   40    71        INIT_FCALL_BY_NAME                                       'imagecolorallocate'
         72        SEND_VAR_EX                                              !24
         73        SEND_VAL_EX                                              88
         74        SEND_VAL_EX                                              211
         75        SEND_VAL_EX                                              247
         76        DO_FCALL                                      0  $77     
         77        ASSIGN                                                   !29, $77
   41    78        INIT_FCALL_BY_NAME                                       'imagecolorallocate'
         79        SEND_VAR_EX                                              !24
         80        SEND_VAL_EX                                              250
         81        SEND_VAL_EX                                              88
         82        SEND_VAL_EX                                              88
         83        DO_FCALL                                      0  $79     
         84        ASSIGN                                                   !30, $79
   43    85        INIT_FCALL_BY_NAME                                       'imagefilltoborder'
         86        SEND_VAR_EX                                              !24
         87        SEND_VAL_EX                                              0
         88        SEND_VAL_EX                                              0
         89        SEND_VAR_EX                                              !27
         90        SEND_VAR_EX                                              !27
         91        DO_FCALL                                      0          
   44    92        INIT_FCALL_BY_NAME                                       'imagecolortransparent'
         93        SEND_VAR_EX                                              !24
         94        SEND_VAR_EX                                              !27
         95        DO_FCALL                                      0          
   47    96      > JMP                                                      ->240
   48    97    > > JMP                                                      ->235
   49    98    >   IS_EQUAL                                         ~83     !15, 2
         99      > JMPZ_EX                                          ~83     ~83, ->105
        100    >   IS_EQUAL                                         ~84     !16, 11
        101      > JMPNZ_EX                                         ~84     ~84, ->104
        102    >   IS_EQUAL                                         ~85     !16, 12
        103        BOOL                                             ~84     ~85
        104    >   BOOL                                             ~83     ~84
        105    > > JMPZ                                                     ~83, ->107
        106    > > JMP                                                      ->232
   52   107    >   INIT_FCALL_BY_NAME                                       'imagerectangle'
        108        SEND_VAR_EX                                              !24
        109        SEND_VAR_EX                                              !0
        110        SEND_VAR_EX                                              !1
        111        ADD                                              ~86     !0, !2
        112        SEND_VAL_EX                                              ~86
        113        ADD                                              ~87     !1, !3
        114        SEND_VAL_EX                                              ~87
        115        SEND_VAR_EX                                              !25
        116        DO_FCALL                                      0          
   53   117        INIT_FCALL_BY_NAME                                       'imagerectangle'
        118        SEND_VAR_EX                                              !24
        119        ADD                                              ~89     !0, !8
        120        SEND_VAL_EX                                              ~89
        121        SEND_VAR_EX                                              !1
        122        ADD                                              ~90     !0, !8
        123        ADD                                              ~91     ~90, !11
        124        SEND_VAL_EX                                              ~91
        125        ADD                                              ~92     !1, !3
        126        SEND_VAL_EX                                              ~92
        127        SEND_VAR_EX                                              !25
        128        DO_FCALL                                      0          
   54   129        INIT_FCALL_BY_NAME                                       'imagerectangle'
        130        SEND_VAR_EX                                              !24
        131        ADD                                              ~94     !0, 3
        132        SEND_VAL_EX                                              ~94
        133        ADD                                              ~95     !1, !3
        134        SEND_VAL_EX                                              ~95
        135        ADD                                              ~96     !0, 28
        136        SEND_VAL_EX                                              ~96
        137        ADD                                              ~97     !1, !3
        138        ADD                                              ~98     ~97, 8
        139        SEND_VAL_EX                                              ~98
        140        SEND_VAR_EX                                              !25
        141        DO_FCALL                                      0          
   55   142        INIT_FCALL_BY_NAME                                       'imagerectangle'
        143        SEND_VAR_EX                                              !24
        144        ADD                                              ~100    !0, 3
        145        SEND_VAL_EX                                              ~100
        146        SUB                                              ~101    !1, 8
        147        SEND_VAL_EX                                              ~101
        148        ADD                                              ~102    !0, 28
        149        SEND_VAL_EX                                              ~102
        150        SEND_VAR_EX                                              !1
        151        SEND_VAR_EX                                              !25
        152        DO_FCALL                                      0          
   57   153        IS_EQUAL                                                 !15, 2
        154      > JMPZ                                                     ~104, ->158
   58   155    >   SUB                                              ~105    15, !16
        156        ASSIGN                                                   !31, ~105
        157      > JMP                                                      ->160
   60   158    >   ADD                                              ~107    14, !16
        159        ASSIGN                                                   !31, ~107
   64   160    >   ROPE_INIT                                     3  ~110    'SELECT+rmods%2C+lmods+FROM+isleinfo+WHERE+islenumber+%3D+%27'
        161        ROPE_ADD                                      1  ~110    ~110, !31
        162        ROPE_END                                      2  ~109    ~110, '%27'
        163        ASSIGN                                                   !32, ~109
   65   164        INIT_FCALL_BY_NAME                                       'mysql_query'
        165        SEND_VAR_EX                                              !32
        166        DO_FCALL                                      0  $113    
        167        ASSIGN                                                   !33, $113
   66   168      > JMP                                                      ->173
   67   169    >   FETCH_DIM_R                                      ~115    !35, 'rmods'
        170        ASSIGN                                                   !34, ~115
   68   171        FETCH_DIM_R                                      ~117    !35, 'lmods'
        172        ASSIGN                                                   !36, ~117
   66   173    >   INIT_FCALL_BY_NAME                                       'mysql_fetch_array'
        174        SEND_VAR_EX                                              !37
        175        DO_FCALL                                      0  $119    
        176        ASSIGN                                           ~120    !35, $119
        177      > JMPNZ                                                    ~120, ->169
   70   178    >   INIT_FCALL_BY_NAME                                       'mysql_close'
        179        SEND_VAR_EX                                              !22
        180        DO_FCALL                                      0          
   72   181        IS_NOT_IDENTICAL                                 ~122    !31, 1
        182      > JMPZ_EX                                          ~122    ~122, ->185
        183    >   IS_NOT_IDENTICAL                                 ~123    !31, 28
        184        BOOL                                             ~122    ~123
        185    > > JMPZ                                                     ~122, ->206
   73   186    >   DIV                                              ~124    200, !34
        187        ASSIGN                                                   !38, ~124
   74   188      > JMP                                                      ->204
   75   189    >   INIT_FCALL_BY_NAME                                       'imageline'
        190        SEND_VAR_EX                                              !24
        191        SEND_VAR_EX                                              !0
        192        MUL                                              ~126    !38, !17
        193        ADD                                              ~127    !1, ~126
        194        SUB                                              ~128    ~127, 1
        195        SEND_VAL_EX                                              ~128
        196        ADD                                              ~129    !0, 8
        197        SEND_VAL_EX                                              ~129
        198        MUL                                              ~130    !38, !17
        199        ADD                                              ~131    !1, ~130
        200        SUB                                              ~132    ~131, 1
        201        SEND_VAL_EX                                              ~132
        202        DO_FCALL                                      0          
   74   203        PRE_INC                                                  !17
        204    >   IS_SMALLER                                               !17, !34
        205      > JMPNZ                                                    ~135, ->189
   79   206    >   IS_NOT_IDENTICAL                                 ~136    !31, 14
        207      > JMPZ_EX                                          ~136    ~136, ->210
        208    >   IS_NOT_IDENTICAL                                 ~137    !31, 15
        209        BOOL                                             ~136    ~137
        210    > > JMPZ                                                     ~136, ->232
   80   211    >   DIV                                              ~138    200, !36
        212        ASSIGN                                                   !38, ~138
   81   213      > JMP                                                      ->230
   82   214    >   INIT_FCALL_BY_NAME                                       'imageline'
        215        SEND_VAR_EX                                              !24
        216        SUB                                              ~140    !0, 37
        217        SEND_VAL_EX                                              ~140
        218        MUL                                              ~141    !38, !17
        219        ADD                                              ~142    !1, ~141
        220        SUB                                              ~143    ~142, 1
        221        SEND_VAL_EX                                              ~143
        222        SUB                                              ~144    !0, 29
        223        SEND_VAL_EX                                              ~144
        224        MUL                                              ~145    !38, !17
        225        ADD                                              ~146    !1, ~145
        226        SUB                                              ~147    ~146, 1
        227        SEND_VAL_EX                                              ~147
        228        DO_FCALL                                      0          
   81   229        PRE_INC                                                  !17
        230    >   IS_SMALLER                                               !17, !36
        231      > JMPNZ                                                    ~150, ->214
   86   232    >   ADD                                              ~151    !0, !12
        233        ASSIGN                                                   !0, ~151
   48   234        PRE_INC                                                  !16
        235    >   IS_SMALLER                                               !16, 15
        236      > JMPNZ                                                    ~154, ->98
   88   237    >   ADD                                              ~155    !1, !13
        238        ASSIGN                                                   !1, ~155
   47   239        PRE_INC                                                  !15
        240    >   IS_SMALLER                                               !15, 3
        241      > JMPNZ                                                    ~158, ->97
   92   242    >   INIT_FCALL_BY_NAME                                       'imagepng'
        243        SEND_VAR_EX                                              !24
        244        DO_FCALL                                      0          
   93   245        INIT_FCALL_BY_NAME                                       'imagedestroy'
        246        SEND_VAR_EX                                              !24
        247        DO_FCALL                                      0          
   94   248      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.18 ms | 1420 KiB | 17 Q