3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php echo "<h2>Arithmetic Operators</h2>"; //Variables $var1 = 10; $var2 = 7; $result=0; $result = $var1 + $var2; echo "<p>".$var1 . " + " . $var2. " = " . $result."</p>"; $result = $var1 - $var2; echo "<p>".$var1 . " - " . $var2. " = " . $result."</p>"; $result = $var1 * $var2; echo "<p>".$var1 . " * " . $var2. " = " . $result."</p>"; $result = $var1 / $var2; echo "<p>".$var1 . " / " . $var2. " = " . $result."</p>"; $result = $var1 % $var2; echo "<p>".$var1 . " % " . $var2. " = " . $result."</p>"; ?>
Output for 7.0.0 - 7.2.0
<h2>Arithmetic Operators</h2> Notice: Undefined variable: var1 in /in/i05NR on line 4 Notice: Undefined variable: var2 in /in/i05NR on line 4 Notice: Undefined variable: var1 in /in/i05NR on line 5 Notice: Undefined variable: var2 in /in/i05NR on line 5 <p> + = 0</p> Notice: Undefined variable: var1 in /in/i05NR on line 5 Notice: Undefined variable: var2 in /in/i05NR on line 5 Notice: Undefined variable: var1 in /in/i05NR on line 6 Notice: Undefined variable: var2 in /in/i05NR on line 6 <p> - = 0</p> Notice: Undefined variable: var1 in /in/i05NR on line 6 Notice: Undefined variable: var2 in /in/i05NR on line 6 Notice: Undefined variable: var1 in /in/i05NR on line 7 Notice: Undefined variable: var2 in /in/i05NR on line 7 <p> * = 0</p> Notice: Undefined variable: var1 in /in/i05NR on line 7 Notice: Undefined variable: var2 in /in/i05NR on line 7 Warning: Division by zero in /in/i05NR on line 7 Notice: Undefined variable: var1 in /in/i05NR on line 8 Notice: Undefined variable: var2 in /in/i05NR on line 8 <p> / = NAN</p> Notice: Undefined variable: var1 in /in/i05NR on line 8 Notice: Undefined variable: var2 in /in/i05NR on line 8 Fatal error: Uncaught DivisionByZeroError: Modulo by zero in /in/i05NR:8 Stack trace: #0 {main} thrown in /in/i05NR on line 8
Process exited with code 255.
Output for 5.2.0 - 5.6.28
<h2>Arithmetic Operators</h2> Notice: Undefined variable: var2 in /in/i05NR on line 4 Notice: Undefined variable: var1 in /in/i05NR on line 4 Notice: Undefined variable: var1 in /in/i05NR on line 5 Notice: Undefined variable: var2 in /in/i05NR on line 5 <p> + = 0</p> Notice: Undefined variable: var2 in /in/i05NR on line 5 Notice: Undefined variable: var1 in /in/i05NR on line 5 Notice: Undefined variable: var1 in /in/i05NR on line 6 Notice: Undefined variable: var2 in /in/i05NR on line 6 <p> - = 0</p> Notice: Undefined variable: var2 in /in/i05NR on line 6 Notice: Undefined variable: var1 in /in/i05NR on line 6 Notice: Undefined variable: var1 in /in/i05NR on line 7 Notice: Undefined variable: var2 in /in/i05NR on line 7 <p> * = 0</p> Notice: Undefined variable: var2 in /in/i05NR on line 7 Notice: Undefined variable: var1 in /in/i05NR on line 7 Warning: Division by zero in /in/i05NR on line 7 Notice: Undefined variable: var1 in /in/i05NR on line 8 Notice: Undefined variable: var2 in /in/i05NR on line 8 <p> / = </p> Notice: Undefined variable: var2 in /in/i05NR on line 8 Notice: Undefined variable: var1 in /in/i05NR on line 8 Warning: Division by zero in /in/i05NR on line 8 Notice: Undefined variable: var1 in /in/i05NR on line 9 Notice: Undefined variable: var2 in /in/i05NR on line 9 <p> % = </p>
Output for 5.1.0 - 5.1.6
<h2>Arithmetic Operators</h2> Notice: Undefined variable: var2 in /in/i05NR on line 4 Notice: Undefined variable: var1 in /in/i05NR on line 4 Notice: Undefined variable: var1 in /in/i05NR on line 5 Notice: Undefined variable: var2 in /in/i05NR on line 5 <p> + = 0</p> Notice: Undefined variable: var2 in /in/i05NR on line 5 Notice: Undefined variable: var1 in /in/i05NR on line 5 Notice: Undefined variable: var1 in /in/i05NR on line 6 Notice: Undefined variable: var2 in /in/i05NR on line 6 <p> - = 0</p> Notice: Undefined variable: var2 in /in/i05NR on line 6 Notice: Undefined variable: var1 in /in/i05NR on line 6 Notice: Undefined variable: var1 in /in/i05NR on line 7 Notice: Undefined variable: var2 in /in/i05NR on line 7 <p> * = 0</p> Notice: Undefined variable: var2 in /in/i05NR on line 7 Notice: Undefined variable: var1 in /in/i05NR on line 7 Warning: Division by zero in /in/i05NR on line 7 Notice: Undefined variable: var1 in /in/i05NR on line 8 Notice: Undefined variable: var2 in /in/i05NR on line 8 <p> / = </p> Notice: Undefined variable: var2 in /in/i05NR on line 8 Notice: Undefined variable: var1 in /in/i05NR on line 8 Notice: Undefined variable: var1 in /in/i05NR on line 9 Notice: Undefined variable: var2 in /in/i05NR on line 9 <p> % = </p>
Output for 5.0.4 - 5.0.5
<h2>Arithmetic Operators</h2> Notice: Undefined variable: var1 in /in/i05NR on line 4 Notice: Undefined variable: var2 in /in/i05NR on line 4 Notice: Undefined variable: var1 in /in/i05NR on line 5 Notice: Undefined variable: var2 in /in/i05NR on line 5 <p> + = 0</p> Notice: Undefined variable: var1 in /in/i05NR on line 5 Notice: Undefined variable: var2 in /in/i05NR on line 5 Notice: Undefined variable: var1 in /in/i05NR on line 6 Notice: Undefined variable: var2 in /in/i05NR on line 6 <p> - = 0</p> Notice: Undefined variable: var1 in /in/i05NR on line 6 Notice: Undefined variable: var2 in /in/i05NR on line 6 Notice: Undefined variable: var1 in /in/i05NR on line 7 Notice: Undefined variable: var2 in /in/i05NR on line 7 <p> * = 0</p> Notice: Undefined variable: var1 in /in/i05NR on line 7 Notice: Undefined variable: var2 in /in/i05NR on line 7 Warning: Division by zero in /in/i05NR on line 7 Notice: Undefined variable: var1 in /in/i05NR on line 8 Notice: Undefined variable: var2 in /in/i05NR on line 8 <p> / = </p> Notice: Undefined variable: var1 in /in/i05NR on line 8 Notice: Undefined variable: var2 in /in/i05NR on line 8 Notice: Undefined variable: var1 in /in/i05NR on line 9 Notice: Undefined variable: var2 in /in/i05NR on line 9 <p> % = </p>
Output for 4.3.0 - 4.4.4, 5.0.0 - 5.0.3
<h2>Arithmetic Operators</h2> Notice: Undefined variable: var1 in /in/i05NR on line 4 Notice: Undefined variable: var2 in /in/i05NR on line 4 Notice: Undefined variable: var1 in /in/i05NR on line 5 Notice: Undefined variable: var2 in /in/i05NR on line 5 <p> + = 0</p> Notice: Undefined variable: var1 in /in/i05NR on line 5 Notice: Undefined variable: var2 in /in/i05NR on line 5 Notice: Undefined variable: var1 in /in/i05NR on line 6 Notice: Undefined variable: var2 in /in/i05NR on line 6 <p> - = 0</p> Notice: Undefined variable: var1 in /in/i05NR on line 6 Notice: Undefined variable: var2 in /in/i05NR on line 6 Notice: Undefined variable: var1 in /in/i05NR on line 7 Notice: Undefined variable: var2 in /in/i05NR on line 7 <p> * = 0</p> Notice: Undefined variable: var1 in /in/i05NR on line 7 Notice: Undefined variable: var2 in /in/i05NR on line 7 Warning: Division by zero in /in/i05NR on line 7 Notice: Undefined variable: var1 in /in/i05NR on line 8 Notice: Undefined variable: var2 in /in/i05NR on line 8 <p> / = </p> Notice: Undefined variable: var1 in /in/i05NR on line 8 Notice: Undefined variable: var2 in /in/i05NR on line 8 Notice: Undefined variable: var1 in /in/i05NR on line 9 Notice: Undefined variable: var2 in /in/i05NR on line 9 <p> % = </p>
Output for 4.4.5 - 4.4.9
<h2>Arithmetic Operators</h2> Notice: Undefined variable: var1 in /in/i05NR on line 4 Notice: Undefined variable: var2 in /in/i05NR on line 4 Notice: Undefined variable: var1 in /in/i05NR on line 5 Notice: Undefined variable: var2 in /in/i05NR on line 5 <p> + = 0</p> Notice: Undefined variable: var1 in /in/i05NR on line 5 Notice: Undefined variable: var2 in /in/i05NR on line 5 Notice: Undefined variable: var1 in /in/i05NR on line 6 Notice: Undefined variable: var2 in /in/i05NR on line 6 <p> - = 0</p> Notice: Undefined variable: var1 in /in/i05NR on line 6 Notice: Undefined variable: var2 in /in/i05NR on line 6 Notice: Undefined variable: var1 in /in/i05NR on line 7 Notice: Undefined variable: var2 in /in/i05NR on line 7 <p> * = 0</p> Notice: Undefined variable: var1 in /in/i05NR on line 7 Notice: Undefined variable: var2 in /in/i05NR on line 7 Warning: Division by zero in /in/i05NR on line 7 Notice: Undefined variable: var1 in /in/i05NR on line 8 Notice: Undefined variable: var2 in /in/i05NR on line 8 <p> / = </p> Notice: Undefined variable: var1 in /in/i05NR on line 8 Notice: Undefined variable: var2 in /in/i05NR on line 8 Warning: Division by zero in /in/i05NR on line 8 Notice: Undefined variable: var1 in /in/i05NR on line 9 Notice: Undefined variable: var2 in /in/i05NR on line 9 <p> % = </p>