3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<form title="Formulário Pontos" id="FormPontos" name="FormPontos" action="" method="post"> <select name="valor1"> <option value="2.5">2,5</option> <option value="3">3</option> </select> <select name="valor2"> <option value="2">2</option> <option value="3">3</option> </select> <input type="hidden" name="oculto" value="efetuar"/> <br /><br/> <input name="calcular" type="submit" value="Calcular"/> <input name="limpar" type="reset" value="Limpar" onclick="javascript:window.location.reload();"/> <br /><br /> </form> </body> <?php $total = ($_POST['valor1'] + $_POST['valor2']); echo "Valor Total da operação: ".$total; ?>
Output for 5.3.0 - 7.2.0
<form title="Formulário Pontos" id="FormPontos" name="FormPontos" action="" method="post"> <select name="valor1"> <option value="2.5">2,5</option> <option value="3">3</option> </select> <select name="valor2"> <option value="2">2</option> <option value="3">3</option> </select> <input type="hidden" name="oculto" value="efetuar"/> <br /><br/> <input name="calcular" type="submit" value="Calcular"/> <input name="limpar" type="reset" value="Limpar" onclick="javascript:window.location.reload();"/> <br /><br /> </form> </body> Notice: Undefined index: valor1 in /in/mjpsR on line 20 Notice: Undefined index: valor2 in /in/mjpsR on line 20 Valor Total da operação: 0
Output for 4.3.0 - 5.2.17
<form title="Formulário Pontos" id="FormPontos" name="FormPontos" action="" method="post"> <select name="valor1"> <option value="2.5">2,5</option> <option value="3">3</option> </select> <select name="valor2"> <option value="2">2</option> <option value="3">3</option> </select> <input type="hidden" name="oculto" value="efetuar"/> <br /><br/> <input name="calcular" type="submit" value="Calcular"/> <input name="limpar" type="reset" value="Limpar" onclick="javascript:window.location.reload();"/> <br /><br /> </form> </body> Notice: Undefined index: valor1 in /in/mjpsR on line 20 Notice: Undefined index: valor2 in /in/mjpsR on line 20 Valor Total da operação: 0