3v4l.org

run code in 500+ PHP versions simultaneously
<?php // Etapa 1: Estrutura de Dados - array multidimensional associativo $usuarios = [ [ 'id' => 1, 'nome' => 'Ana Souza', 'email' => 'ana.souza@email.com', 'perfil' => 'Administrador' ], [ 'id' => 2, 'nome' => 'Bruno Lima', 'email' => 'bruno.lima@email.com', 'perfil' => 'Editor' ], [ 'id' => 3, 'nome' => 'Carla Mendes', 'email' => 'carla.mendes@email.com', 'perfil' => 'Visitante' ], [ 'id' => 4, 'nome' => 'Diego Alves', 'email' => 'diego.alves@email.com', 'perfil' => 'Editor' ], ]; ?> <!DOCTYPE html> <html lang="pt-br"> <head> <meta charset="UTF-8"> <title>Tabela de Usuários</title> <style> body { font-family: Arial, sans-serif; background-color: #f4f4f4; padding: 20px; } table { width: 100%; border-collapse: collapse; background-color: #fff; box-shadow: 0 0 5px rgba(0,0,0,0.1); } thead { background-color: #333; color: #fff; } th, td { border: 1px solid #ddd; padding: 10px 14px; text-align: left; } tbody tr:nth-child(even) { background-color: #f9f9f9; } tbody tr:hover { background-color: #f1f1f1; } .btn-editar, .btn-excluir { display: inline-block; padding: 5px 10px; margin-right: 5px; border-radius: 4px; text-decoration: none; color: #fff; font-size: 13px; } .btn-editar { background-color: #2b8a3e; } .btn-editar:hover { background-color: #237030; } .btn-excluir { background-color: #c92a2a; } .btn-excluir:hover { background-color: #a61e1e; } </style> </head> <body> <h1>Lista de Usuários</h1> <table> <thead> <tr> <th>ID</th> <th>Nome</th> <th>E-mail</th> <th>Perfil</th> <th>Ações</th> </tr> </thead> <tbody> <?php foreach ($usuarios as $user): ?> <tr> <td><?= $user['id'] ?></td> <td><?= $user['nome'] ?></td> <td><?= $user['email'] ?></td> <td><?= $user['perfil'] ?></td> <td> <a class="btn-editar" href="form_usuario.php?id=<?= $user['id'] ?>">Editar</a> <a class="btn-excluir" href="excluir_usuario.php?id=<?= $user['id'] ?>">Excluir</a> </td> </tr> <?php endforeach; ?> </tbody> </table> </body> </html>
Output for git.master, git.master_jit
<!DOCTYPE html> <html lang="pt-br"> <head> <meta charset="UTF-8"> <title>Tabela de Usuários</title> <style> body { font-family: Arial, sans-serif; background-color: #f4f4f4; padding: 20px; } table { width: 100%; border-collapse: collapse; background-color: #fff; box-shadow: 0 0 5px rgba(0,0,0,0.1); } thead { background-color: #333; color: #fff; } th, td { border: 1px solid #ddd; padding: 10px 14px; text-align: left; } tbody tr:nth-child(even) { background-color: #f9f9f9; } tbody tr:hover { background-color: #f1f1f1; } .btn-editar, .btn-excluir { display: inline-block; padding: 5px 10px; margin-right: 5px; border-radius: 4px; text-decoration: none; color: #fff; font-size: 13px; } .btn-editar { background-color: #2b8a3e; } .btn-editar:hover { background-color: #237030; } .btn-excluir { background-color: #c92a2a; } .btn-excluir:hover { background-color: #a61e1e; } </style> </head> <body> <h1>Lista de Usuários</h1> <table> <thead> <tr> <th>ID</th> <th>Nome</th> <th>E-mail</th> <th>Perfil</th> <th>Ações</th> </tr> </thead> <tbody> <tr> <td>1</td> <td>Ana Souza</td> <td>ana.souza@email.com</td> <td>Administrador</td> <td> <a class="btn-editar" href="form_usuario.php?id=1">Editar</a> <a class="btn-excluir" href="excluir_usuario.php?id=1">Excluir</a> </td> </tr> <tr> <td>2</td> <td>Bruno Lima</td> <td>bruno.lima@email.com</td> <td>Editor</td> <td> <a class="btn-editar" href="form_usuario.php?id=2">Editar</a> <a class="btn-excluir" href="excluir_usuario.php?id=2">Excluir</a> </td> </tr> <tr> <td>3</td> <td>Carla Mendes</td> <td>carla.mendes@email.com</td> <td>Visitante</td> <td> <a class="btn-editar" href="form_usuario.php?id=3">Editar</a> <a class="btn-excluir" href="excluir_usuario.php?id=3">Excluir</a> </td> </tr> <tr> <td>4</td> <td>Diego Alves</td> <td>diego.alves@email.com</td> <td>Editor</td> <td> <a class="btn-editar" href="form_usuario.php?id=4">Editar</a> <a class="btn-excluir" href="excluir_usuario.php?id=4">Excluir</a> </td> </tr> </tbody> </table> </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:
40.25 ms | 1090 KiB | 4 Q