3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php ?> <!DOCTYPE> <html> <body> <?php if(round > 0 && $guess == $number) : ?> <h1>[game <?php echo $last_round?> result]</h1> <br> user guessed <?php echo $guess;?>, the number was <?php echo $number;?> and the number <?php echo $number;?> came up <br> user got a win <?php else : ?> <h1>[game <?php echo $round?> result]</h1> user guessed <?php echo $guess;?>, the number was <?php echo $number;?> and the number <?php echo $number;?> came up <br> user got a loss <?php endif; ?> <br> <a href="reset.php">reset</a> <br> <h2>current score</h2> <br> <table> <tr><td>user</td><td><?php echo $scoreU;?></td></tr> <tr><td>computer</td><td><?php echo $scoreC;?></td></tr> </table> <br> <br> <h1>[game<?php echo $round;?>]</h1> <br> <h3>the next random number from 0-10 will be</h3> <br> <?php if(round/5 == 0) : ?> exactly <input type="text" name="guess"> <?php else : ?> <input type="button" name="higher"> higher than <?php ?> <input type="button" name="lower"> lower than <?php ?> <?php endif; ?> <button type="submit">make your guess</button> </body> </html>
Output for 7.2.0
<!DOCTYPE> <html> <body> Warning: Use of undefined constant round - assumed 'round' (this will throw an Error in a future version of PHP) in /in/kga7f on line 8 <h1>[game Notice: Undefined variable: round in /in/kga7f on line 15 result]</h1> user guessed Notice: Undefined variable: guess in /in/kga7f on line 16 , the number was Notice: Undefined variable: number in /in/kga7f on line 16 and the number Notice: Undefined variable: number in /in/kga7f on line 16 came up <br> user got a loss <br> <a href="reset.php">reset</a> <br> <h2>current score</h2> <br> <table> <tr><td>user</td><td> Notice: Undefined variable: scoreU in /in/kga7f on line 27 </td></tr> <tr><td>computer</td><td> Notice: Undefined variable: scoreC in /in/kga7f on line 28 </td></tr> </table> <br> <br> <h1>[game Notice: Undefined variable: round in /in/kga7f on line 34 ]</h1> <br> <h3>the next random number from 0-10 will be</h3> <br> Warning: Use of undefined constant round - assumed 'round' (this will throw an Error in a future version of PHP) in /in/kga7f on line 39 Warning: A non-numeric value encountered in /in/kga7f on line 39 exactly <input type="text" name="guess"> <button type="submit">make your guess</button> </body> </html>
Output for 7.1.0 - 7.1.10
<!DOCTYPE> <html> <body> Notice: Use of undefined constant round - assumed 'round' in /in/kga7f on line 8 <h1>[game Notice: Undefined variable: round in /in/kga7f on line 15 result]</h1> user guessed Notice: Undefined variable: guess in /in/kga7f on line 16 , the number was Notice: Undefined variable: number in /in/kga7f on line 16 and the number Notice: Undefined variable: number in /in/kga7f on line 16 came up <br> user got a loss <br> <a href="reset.php">reset</a> <br> <h2>current score</h2> <br> <table> <tr><td>user</td><td> Notice: Undefined variable: scoreU in /in/kga7f on line 27 </td></tr> <tr><td>computer</td><td> Notice: Undefined variable: scoreC in /in/kga7f on line 28 </td></tr> </table> <br> <br> <h1>[game Notice: Undefined variable: round in /in/kga7f on line 34 ]</h1> <br> <h3>the next random number from 0-10 will be</h3> <br> Notice: Use of undefined constant round - assumed 'round' in /in/kga7f on line 39 Warning: A non-numeric value encountered in /in/kga7f on line 39 exactly <input type="text" name="guess"> <button type="submit">make your guess</button> </body> </html>
Output for 5.3.19 - 7.0.20
<!DOCTYPE> <html> <body> Notice: Use of undefined constant round - assumed 'round' in /in/kga7f on line 8 <h1>[game Notice: Undefined variable: round in /in/kga7f on line 15 result]</h1> user guessed Notice: Undefined variable: guess in /in/kga7f on line 16 , the number was Notice: Undefined variable: number in /in/kga7f on line 16 and the number Notice: Undefined variable: number in /in/kga7f on line 16 came up <br> user got a loss <br> <a href="reset.php">reset</a> <br> <h2>current score</h2> <br> <table> <tr><td>user</td><td> Notice: Undefined variable: scoreU in /in/kga7f on line 27 </td></tr> <tr><td>computer</td><td> Notice: Undefined variable: scoreC in /in/kga7f on line 28 </td></tr> </table> <br> <br> <h1>[game Notice: Undefined variable: round in /in/kga7f on line 34 ]</h1> <br> <h3>the next random number from 0-10 will be</h3> <br> Notice: Use of undefined constant round - assumed 'round' in /in/kga7f on line 39 exactly <input type="text" name="guess"> <button type="submit">make your guess</button> </body> </html>