3v4l.org

run code in 300+ PHP versions simultaneously
<?php $verz="1.0"; $comPort = "/dev/ttyACM0"; /*change to correct com port */ if (isset($_POST["rcmd"])) { $rcmd = $_POST["rcmd"]; switch ($rcmd) { case D: $fp =fopen($comPort, "w"); fwrite($fp, chr(100)); fclose($fp); break; case A: $fp =fopen($comPort, "w"); fwrite($fp, chr(97)); fclose($fp); break; case W: $fp =fopen($comPort, "w"); fwrite($fp, chr(119)); fclose($fp); break; case S: $fp =fopen($comPort, "w"); fwrite($fp, chr(115)); fclose($fp); break; case T: $fp =fopen($comPort, "w"); fwrite($fp, chr(116)); fclose($fp); break; case G: $fp =fopen($comPort, "w"); fwrite($fp, chr(103)); fclose($fp); break; case H: $fp =fopen($comPort, "w"); fwrite($fp, chr(104)); fclose($fp); break; case F: $fp =fopen($comPort, "w"); fwrite($fp, chr(102)); fclose($fp); break; case U: $fp =fopen($comPort, "w"); fwrite($fp, chr(117)); fclose($fp); break; case J: $fp =fopen($comPort, "w"); fwrite($fp, chr(106)); fclose($fp); break; case Lights: $fp =fopen($comPort, "w"); fwrite($fp, chr(110)); fclose($fp); break; case Home: $fp =fopen($comPort, "w"); fwrite($fp, chr(109)); fclose($fp); break; default: die('Something is wrong. Fix it.'); } } ?> <html> <body> <center><h1>Control Mivinci!</h1><b>Version <?php echo $verz; ?></b></center> <body style="background-color:yellow;"> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <div style="float: left; width: 700px; height: 500px;"> <iframe frameborder="0" width="700" height="500" src="http://192.168.23.111:8081/"></iframe> </div> <div id="controls" style="float:left;"> <form method="post" action="<?php echo $PHP_SELF;?>"> <br /> <br /> <br /> <br /> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <input type="submit" value="W" name="rcmd"> <br/> <br /> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <input type="submit" value="A" name="rcmd"> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <input type="submit" value="D" name="rcmd"> <br/> <br /> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <input type="submit" value="S" name="rcmd"> <br/> <br /> <br /> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <input type="submit" value="T" name="rcmd"> <br/> <br /> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <input type="submit" value="F" name="rcmd"> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <input type="submit" value="H" name="rcmd"><br/> <br /> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <input type="submit" value="G" name="rcmd"> <br /> <br /> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <input type="submit" value="U" name="rcmd"> <br/> <br /> <br /> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <input type="submit" value="V" name="rcmd"><br/> <br /> <br /> &nbsp&nbsp&nbsp&nbsp <input type="submit" value="Home" name="rcmd"> &nbsp <input type="submit" value="Lights" name="rcmd"> </form> </div> </div> <div class="clear: both;">&nbsp;</div> <br /> <br /> <br /> </body> </html>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 202
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 45
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 58
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 71
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 84
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 97
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 110
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 123
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 136
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 149
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 38, Position 2 = 162
Branch analysis from position: 38
2 jumps found. (Code = 44) Position 1 = 41, Position 2 = 175
Branch analysis from position: 41
2 jumps found. (Code = 44) Position 1 = 44, Position 2 = 188
Branch analysis from position: 44
1 jumps found. (Code = 42) Position 1 = 201
Branch analysis from position: 201
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 188
1 jumps found. (Code = 42) Position 1 = 202
Branch analysis from position: 202
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 175
1 jumps found. (Code = 42) Position 1 = 202
Branch analysis from position: 202
Branch analysis from position: 162
1 jumps found. (Code = 42) Position 1 = 202
Branch analysis from position: 202
Branch analysis from position: 149
1 jumps found. (Code = 42) Position 1 = 202
Branch analysis from position: 202
Branch analysis from position: 136
1 jumps found. (Code = 42) Position 1 = 202
Branch analysis from position: 202
Branch analysis from position: 123
1 jumps found. (Code = 42) Position 1 = 202
Branch analysis from position: 202
Branch analysis from position: 110
1 jumps found. (Code = 42) Position 1 = 202
Branch analysis from position: 202
Branch analysis from position: 97
1 jumps found. (Code = 42) Position 1 = 202
Branch analysis from position: 202
Branch analysis from position: 84
1 jumps found. (Code = 42) Position 1 = 202
Branch analysis from position: 202
Branch analysis from position: 71
1 jumps found. (Code = 42) Position 1 = 202
Branch analysis from position: 202
Branch analysis from position: 58
1 jumps found. (Code = 42) Position 1 = 202
Branch analysis from position: 202
Branch analysis from position: 45
1 jumps found. (Code = 42) Position 1 = 202
Branch analysis from position: 202
Branch analysis from position: 202
filename:       /in/p7TnD
function name:  (null)
number of ops:  208
compiled vars:  !0 = $verz, !1 = $comPort, !2 = $rcmd, !3 = $fp, !4 = $PHP_SELF
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '1.0'
    4     1        ASSIGN                                                   !1, '%2Fdev%2FttyACM0'
    6     2        FETCH_IS                                         ~7      '_POST'
          3        ISSET_ISEMPTY_DIM_OBJ                         0          ~7, 'rcmd'
          4      > JMPZ                                                     ~8, ->202
    7     5    >   FETCH_R                      global              ~9      '_POST'
          6        FETCH_DIM_R                                      ~10     ~9, 'rcmd'
          7        ASSIGN                                                   !2, ~10
   10     8        FETCH_CONSTANT                                   ~13     'D'
          9        IS_EQUAL                                                 !2, ~13
         10      > JMPNZ                                                    ~12, ->45
   15    11    >   FETCH_CONSTANT                                   ~14     'A'
         12        IS_EQUAL                                                 !2, ~14
         13      > JMPNZ                                                    ~12, ->58
   20    14    >   FETCH_CONSTANT                                   ~15     'W'
         15        IS_EQUAL                                                 !2, ~15
         16      > JMPNZ                                                    ~12, ->71
   25    17    >   FETCH_CONSTANT                                   ~16     'S'
         18        IS_EQUAL                                                 !2, ~16
         19      > JMPNZ                                                    ~12, ->84
   32    20    >   FETCH_CONSTANT                                   ~17     'T'
         21        IS_EQUAL                                                 !2, ~17
         22      > JMPNZ                                                    ~12, ->97
   37    23    >   FETCH_CONSTANT                                   ~18     'G'
         24        IS_EQUAL                                                 !2, ~18
         25      > JMPNZ                                                    ~12, ->110
   42    26    >   FETCH_CONSTANT                                   ~19     'H'
         27        IS_EQUAL                                                 !2, ~19
         28      > JMPNZ                                                    ~12, ->123
   47    29    >   FETCH_CONSTANT                                   ~20     'F'
         30        IS_EQUAL                                                 !2, ~20
         31      > JMPNZ                                                    ~12, ->136
   53    32    >   FETCH_CONSTANT                                   ~21     'U'
         33        IS_EQUAL                                                 !2, ~21
         34      > JMPNZ                                                    ~12, ->149
   58    35    >   FETCH_CONSTANT                                   ~22     'J'
         36        IS_EQUAL                                                 !2, ~22
         37      > JMPNZ                                                    ~12, ->162
   63    38    >   FETCH_CONSTANT                                   ~23     'Lights'
         39        IS_EQUAL                                                 !2, ~23
         40      > JMPNZ                                                    ~12, ->175
   68    41    >   FETCH_CONSTANT                                   ~24     'Home'
         42        IS_EQUAL                                                 !2, ~24
         43      > JMPNZ                                                    ~12, ->188
         44    > > JMP                                                      ->201
   11    45    >   INIT_FCALL                                               'fopen'
         46        SEND_VAR                                                 !1
         47        SEND_VAL                                                 'w'
         48        DO_ICALL                                         $25     
         49        ASSIGN                                                   !3, $25
   12    50        INIT_FCALL                                               'fwrite'
         51        SEND_VAR                                                 !3
         52        SEND_VAL                                                 'd'
         53        DO_ICALL                                                 
   13    54        INIT_FCALL                                               'fclose'
         55        SEND_VAR                                                 !3
         56        DO_ICALL                                                 
   14    57      > JMP                                                      ->202
   16    58    >   INIT_FCALL                                               'fopen'
         59        SEND_VAR                                                 !1
         60        SEND_VAL                                                 'w'
         61        DO_ICALL                                         $29     
         62        ASSIGN                                                   !3, $29
   17    63        INIT_FCALL                                               'fwrite'
         64        SEND_VAR                                                 !3
         65        SEND_VAL                                                 'a'
         66        DO_ICALL                                                 
   18    67        INIT_FCALL                                               'fclose'
         68        SEND_VAR                                                 !3
         69        DO_ICALL                                                 
   19    70      > JMP                                                      ->202
   21    71    >   INIT_FCALL                                               'fopen'
         72        SEND_VAR                                                 !1
         73        SEND_VAL                                                 'w'
         74        DO_ICALL                                         $33     
         75        ASSIGN                                                   !3, $33
   22    76        INIT_FCALL                                               'fwrite'
         77        SEND_VAR                                                 !3
         78        SEND_VAL                                                 'w'
         79        DO_ICALL                                                 
   23    80        INIT_FCALL                                               'fclose'
         81        SEND_VAR                                                 !3
         82        DO_ICALL                                                 
   24    83      > JMP                                                      ->202
   26    84    >   INIT_FCALL                                               'fopen'
         85        SEND_VAR                                                 !1
         86        SEND_VAL                                                 'w'
         87        DO_ICALL                                         $37     
         88        ASSIGN                                                   !3, $37
   27    89        INIT_FCALL                                               'fwrite'
         90        SEND_VAR                                                 !3
         91        SEND_VAL                                                 's'
         92        DO_ICALL                                                 
   28    93        INIT_FCALL                                               'fclose'
         94        SEND_VAR                                                 !3
         95        DO_ICALL                                                 
   29    96      > JMP                                                      ->202
   33    97    >   INIT_FCALL                                               'fopen'
         98        SEND_VAR                                                 !1
         99        SEND_VAL                                                 'w'
        100        DO_ICALL                                         $41     
        101        ASSIGN                                                   !3, $41
   34   102        INIT_FCALL                                               'fwrite'
        103        SEND_VAR                                                 !3
        104        SEND_VAL                                                 't'
        105        DO_ICALL                                                 
   35   106        INIT_FCALL                                               'fclose'
        107        SEND_VAR                                                 !3
        108        DO_ICALL                                                 
   36   109      > JMP                                                      ->202
   38   110    >   INIT_FCALL                                               'fopen'
        111        SEND_VAR                                                 !1
        112        SEND_VAL                                                 'w'
        113        DO_ICALL                                         $45     
        114        ASSIGN                                                   !3, $45
   39   115        INIT_FCALL                                               'fwrite'
        116        SEND_VAR                                                 !3
        117        SEND_VAL                                                 'g'
        118        DO_ICALL                                                 
   40   119        INIT_FCALL                                               'fclose'
        120        SEND_VAR                                                 !3
        121        DO_ICALL                                                 
   41   122      > JMP                                                      ->202
   43   123    >   INIT_FCALL                                               'fopen'
        124        SEND_VAR                                                 !1
        125        SEND_VAL                                                 'w'
        126        DO_ICALL                                         $49     
        127        ASSIGN                                                   !3, $49
   44   128        INIT_FCALL                                               'fwrite'
        129        SEND_VAR                                                 !3
        130        SEND_VAL                                                 'h'
        131        DO_ICALL                                                 
   45   132        INIT_FCALL                                               'fclose'
        133        SEND_VAR                                                 !3
        134        DO_ICALL                                                 
   46   135      > JMP                                                      ->202
   48   136    >   INIT_FCALL                                               'fopen'
        137        SEND_VAR                                                 !1
        138        SEND_VAL                                                 'w'
        139        DO_ICALL                                         $53     
        140        ASSIGN                                                   !3, $53
   49   141        INIT_FCALL                                               'fwrite'
        142        SEND_VAR                                                 !3
        143        SEND_VAL                                                 'f'
        144        DO_ICALL                                                 
   50   145        INIT_FCALL                                               'fclose'
        146        SEND_VAR                                                 !3
        147        DO_ICALL                                                 
   51   148      > JMP                                                      ->202
   54   149    >   INIT_FCALL                                               'fopen'
        150        SEND_VAR                                                 !1
        151        SEND_VAL                                                 'w'
        152        DO_ICALL                                         $57     
        153        ASSIGN                                                   !3, $57
   55   154        INIT_FCALL                                               'fwrite'
        155        SEND_VAR                                                 !3
        156        SEND_VAL                                                 'u'
        157        DO_ICALL                                                 
   56   158        INIT_FCALL                                               'fclose'
        159        SEND_VAR                                                 !3
        160        DO_ICALL                                                 
   57   161      > JMP                                                      ->202
   59   162    >   INIT_FCALL                                               'fopen'
        163        SEND_VAR                                                 !1
        164        SEND_VAL                                                 'w'
        165        DO_ICALL                                         $61     
        166        ASSIGN                                                   !3, $61
   60   167        INIT_FCALL                                               'fwrite'
        168        SEND_VAR                                                 !3
        169        SEND_VAL                                                 'j'
        170        DO_ICALL                                                 
   61   171        INIT_FCALL                                               'fclose'
        172        SEND_VAR                                                 !3
        173        DO_ICALL                                                 
   62   174      > JMP                                                      ->202
   64   175    >   INIT_FCALL                                               'fopen'
        176        SEND_VAR                                                 !1
        177        SEND_VAL                                                 'w'
        178        DO_ICALL                                         $65     
        179        ASSIGN                                                   !3, $65
   65   180        INIT_FCALL                                               'fwrite'
        181        SEND_VAR                                                 !3
        182        SEND_VAL                                                 'n'
        183        DO_ICALL                                                 
   66   184        INIT_FCALL                                               'fclose'
        185        SEND_VAR                                                 !3
        186        DO_ICALL                                                 
   67   187      > JMP                                                      ->202
   69   188    >   INIT_FCALL                                               'fopen'
        189        SEND_VAR                                                 !1
        190        SEND_VAL                                                 'w'
        191        DO_ICALL                                         $69     
        192        ASSIGN                                                   !3, $69
   70   193        INIT_FCALL                                               'fwrite'
        194        SEND_VAR                                                 !3
        195        SEND_VAL                                                 'm'
        196        DO_ICALL                                                 
   71   197        INIT_FCALL                                               'fclose'
        198        SEND_VAR                                                 !3
        199        DO_ICALL                                                 
   72   200      > JMP                                                      ->202
   74   201    > > EXIT                                                     'Something+is+wrong.++Fix+it.'
   79   202    >   ECHO                                                     '%0A%0A%0A%0A%0A%3Chtml%3E%0A%09%3Cbody%3E%0A%09%09%3Ccenter%3E%3Ch1%3EControl+Mivinci%21%3C%2Fh1%3E%3Cb%3EVersion+'
   86   203        ECHO                                                     !0
        204        ECHO                                                     '%3C%2Fb%3E%3C%2Fcenter%3E%0A%09%09%3Cbody+style%3D%22background-color%3Ayellow%3B%22%3E%0A%0A%09%09%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%0A%09%09%0A%09%09%3Cdiv+style%3D%22float%3A+left%3B+width%3A+700px%3B+height%3A+500px%3B%22%3E%0A++++++++%09%09%3Ciframe+frameborder%3D%220%22+width%3D%22700%22+height%3D%22500%22+src%3D%22http%3A%2F%2F192.168.23.111%3A8081%2F%22%3E%3C%2Fiframe%3E%0A++++%09%09%3C%2Fdiv%3E%0A%09%09%3Cdiv+id%3D%22controls%22+style%3D%22float%3Aleft%3B%22%3E%0A%09%09%09%3Cform+method%3D%22post%22+action%3D%22'
   95   205        ECHO                                                     !4
        206        ECHO                                                     '%22%3E%0A%3Cbr+%2F%3E%0A%3Cbr+%2F%3E%0A%3Cbr+%2F%3E%0A%3Cbr+%2F%3E%0A%0A%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%0A%3Cinput+type%3D%22submit%22+value%3D%22W%22+name%3D%22rcmd%22%3E%0A%3Cbr%2F%3E%0A%3Cbr+%2F%3E%0A%0A%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%0A%3Cinput+type%3D%22submit%22+value%3D%22A%22+name%3D%22rcmd%22%3E%0A%0A%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%0A%3Cinput+type%3D%22submit%22+value%3D%22D%22+name%3D%22rcmd%22%3E%0A%3Cbr%2F%3E%0A%3Cbr+%2F%3E%0A%0A%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%0A%3Cinput+type%3D%22submit%22+value%3D%22S%22+name%3D%22rcmd%22%3E%0A%3Cbr%2F%3E%0A%3Cbr+%2F%3E%0A%3Cbr+%2F%3E%0A%0A%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%0A%3Cinput+type%3D%22submit%22+value%3D%22T%22+name%3D%22rcmd%22%3E%0A%3Cbr%2F%3E%0A%3Cbr+%2F%3E%0A%0A%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%0A%3Cinput+type%3D%22submit%22+value%3D%22F%22+name%3D%22rcmd%22%3E%0A%0A%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%0A%3Cinput+type%3D%22submit%22+value%3D%22H%22+name%3D%22rcmd%22%3E%3Cbr%2F%3E%0A%3Cbr+%2F%3E%0A%0A%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%0A%3Cinput+type%3D%22submit%22+value%3D%22G%22+name%3D%22rcmd%22%3E%0A%3Cbr+%2F%3E%0A%3Cbr+%2F%3E%0A%0A%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%0A%3Cinput+type%3D%22submit%22+value%3D%22U%22+name%3D%22rcmd%22%3E%0A%3Cbr%2F%3E%0A%3Cbr+%2F%3E%0A%3Cbr+%2F%3E%0A%0A%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%26nbsp%0A%3Cinput+type%3D%22submit%22+value%3D%22V%22+name%3D%22rcmd%22%3E%3Cbr%2F%3E%0A%0A%3Cbr+%2F%3E%0A%3Cbr+%2F%3E%0A%0A%26nbsp%26nbsp%26nbsp%26nbsp%0A%3Cinput+type%3D%22submit%22+value%3D%22Home%22+name%3D%22rcmd%22%3E%0A%26nbsp%0A%3Cinput+type%3D%22submit%22+value%3D%22Lights%22+name%3D%22rcmd%22%3E%0A%0A%0A%3C%2Fform%3E%0A%0A%3C%2Fdiv%3E%0A%3C%2Fdiv%3E%0A%3Cdiv+class%3D%22clear%3A+both%3B%22%3E%26nbsp%3B%3C%2Fdiv%3E%0A%0A%3Cbr+%2F%3E%0A%3Cbr+%2F%3E%0A%3Cbr+%2F%3E%0A%0A%0A%0A%3C%2Fbody%3E%0A%3C%2Fhtml%3E'
  168   207      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.26 ms | 1416 KiB | 19 Q