3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<TITLE>main.php</TITLE> <html> <body> <?php if ( $_REQUEST[boton1] !=""){ $numero=$_POST; echo "Calcular factorial del numero $numero:<br><br>"; echo "<b>$numero!</b>="; $ac=1; $n=$numero; while($n>=2) { echo "$n"; echo "x"; $ac=$n*$ac; $n--; } if($n==1) { echo "$n"; $ac=$n*$ac; } echo "="; echo "<b>$ac</b>\n"; echo "<br></br>"; } else { ?> <H1>Ingrese el Numero a Calcular el Factorial</H1> <Hr> <FORM ACTION="main.php" METHOD="POST"> Numero: <INPUT TYPE="TEXT" NAME="number" size="10"> <Br> <INPUT TYPE="SUBMIT" NAME="boton1" VALUE="Ingresar"> </FORM> <?php } ?> <body> </html>
Output for 5.3.0 - 7.1.0
<TITLE>main.php</TITLE> <html> <body> Notice: Use of undefined constant boton1 - assumed 'boton1' in /in/cuQd7 on line 5 Notice: Undefined index: boton1 in /in/cuQd7 on line 5 <H1>Ingrese el Numero a Calcular el Factorial</H1> <Hr> <FORM ACTION="main.php" METHOD="POST"> Numero: <INPUT TYPE="TEXT" NAME="number" size="10"> <Br> <INPUT TYPE="SUBMIT" NAME="boton1" VALUE="Ingresar"> </FORM> <body> </html>
Output for 4.3.0 - 5.2.17
<TITLE>main.php</TITLE> <html> <body> Notice: Use of undefined constant boton1 - assumed 'boton1' in /in/cuQd7 on line 5 Notice: Undefined index: boton1 in /in/cuQd7 on line 5 <H1>Ingrese el Numero a Calcular el Factorial</H1> <Hr> <FORM ACTION="main.php" METHOD="POST"> Numero: <INPUT TYPE="TEXT" NAME="number" size="10"> <Br> <INPUT TYPE="SUBMIT" NAME="boton1" VALUE="Ingresar"> </FORM> <body> </html>