3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Calc{ var $number1; var $number2; public function add($number1, $number2){ $add = $number1 + $number2; return $add; } public function mult($number1, $number2){ $mult = $number1 * $number2; return $mult; } public function sub($number1, $number2){ $sub = $number1 - $number2; return $sub } public function div($number1, $number2){ $div = $number1 / $number2; return $div; } } if (isset($_POST['formNumber1']) && isset($_POST['formNumber2'])) { $calc = new Calc; echo $calc->add($_POST['formNumber1'], $_POST['formNumber2']); } ?> <form action="Calculator1.php" method="post"> <input type="text" name="formNumber1" maxlength='100' /> <input type="text" name="formNumber2" maxlength='100' /> <input type="submit" name="formSubmit" value="Submit" /> </form>
Output for 5.3.0 - 5.5.3
Parse error: syntax error, unexpected '}' in /in/ErU2n on line 19
Process exited with code 255.