3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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> <body style="background-color:yellow;"> <center> <p style="font-family:Arial;color:red;font-size:45px;">Mivinci!</p> <p style="font-family:verdana;color:black;font-size:25px;">Control Mivinci From Anywhere!</p> <b>Version <?php echo $verz; ?></b> </center> <br/> <br/> &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> <br /> <br /> <br /> </body> </html>
Output for 5.0.4 - 7.1.0
<html> <body> <body style="background-color:yellow;"> <center> <p style="font-family:Arial;color:red;font-size:45px;">Mivinci!</p> <p style="font-family:verdana;color:black;font-size:25px;">Control Mivinci From Anywhere!</p> <b>Version 1.0</b> </center> <br/> <br/> &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=" Notice: Undefined variable: PHP_SELF in /in/SYYek on line 101 "> <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> <br /> <br /> <br /> </body> </html>
Output for 4.3.0 - 5.0.3
<html> <body> <body style="background-color:yellow;"> <center> <p style="font-family:Arial;color:red;font-size:45px;">Mivinci!</p> <p style="font-family:verdana;color:black;font-size:25px;">Control Mivinci From Anywhere!</p> <b>Version 1.0</b> </center> <br/> <br/> &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=" Notice: Undefined variable: PHP_SELF in /in/SYYek on line 101 "> <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> <br /> <br /> <br /> </body> </html>