3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php include "robot.html"; $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>
Output for 5.1.0 - 7.1.0
Warning: include(robot.html): failed to open stream: No such file or directory in /in/eTT08 on line 3 Warning: include(): Failed opening 'robot.html' for inclusion (include_path='.:') in /in/eTT08 on line 3 <html> <body> <center><h1>Control Mivinci!</h1><b>Version 1.0</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=" Notice: Undefined variable: PHP_SELF in /in/eTT08 on line 97 "> <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>
Output for 5.0.4 - 5.0.5
Warning: main(robot.html): failed to open stream: No such file or directory in /in/eTT08 on line 3 Warning: main(): Failed opening 'robot.html' for inclusion (include_path='.:') in /in/eTT08 on line 3 <html> <body> <center><h1>Control Mivinci!</h1><b>Version 1.0</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=" Notice: Undefined variable: PHP_SELF in /in/eTT08 on line 97 "> <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>
Output for 4.3.2 - 5.0.3
Warning: main(robot.html): failed to open stream: No such file or directory in /in/eTT08 on line 3 Warning: main(): Failed opening 'robot.html' for inclusion (include_path='.:') in /in/eTT08 on line 3 <html> <body> <center><h1>Control Mivinci!</h1><b>Version 1.0</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=" Notice: Undefined variable: PHP_SELF in /in/eTT08 on line 97 "> <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>
Output for 4.3.0 - 4.3.1
Warning: main(robot.html) [http://www.php.net/function.main]: failed to create stream: No such file or directory in /in/eTT08 on line 3 Warning: main() [http://www.php.net/function.main]: Failed opening 'robot.html' for inclusion (include_path='.:') in /in/eTT08 on line 3 <html> <body> <center><h1>Control Mivinci!</h1><b>Version 1.0</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=" Notice: Undefined variable: PHP_SELF in /in/eTT08 on line 97 "> <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>