3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (!isset($_POST["num"])): ?> <html> <head> <title>Exercício 7</title> </head> <body> <form action=exercicio7.php method="post"> Insira o código do produto: <input type="text" name="num" /></br> <input type="submit" value="Enviar" /> </form> </body> </html> <?php else : $cod = $_POST["num"]; switch ( $cod ){ case 1: $mensagem = 'Alimento não-perecível'; break; case 2: case 3: case 4: $mensagem = 'Alimento perecível'; break; case 5: case 6: $mensagem = 'Vestuário'; break; case 7: $mensagem = 'Higiene pessoal'; break; case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 15: $mensagem = 'Limpeza'; break; default: $mensagem = 'Código inválido'; } echo $mensagem; ?> <?php endif; ?>
Output for git.master, git.master_jit, rfc.property-hooks
<html> <head> <title>Exercício 7</title> </head> <body> <form action=exercicio7.php method="post"> Insira o código do produto: <input type="text" name="num" /></br> <input type="submit" value="Enviar" /> </form> </body> </html>

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
35.64 ms | 401 KiB | 8 Q