3v4l.org

run code in 300+ PHP versions simultaneously
<?php foreach($conn->query($sql) as $row){ if(isset($_SESSION['user_id'])){ echo "<tr><td>".$row['Product_ID']."</td><td>".$row['Naam']."</td><td>".$row['Prijs']."</td><td>".$row['Beschrijving']."</td><td><a class='but_add' href='addItem.php?add=$row[Product_ID]'><i class='far fa-plus-square fa-s'></i> Add</a></td></tr>"; }else{ echo "<tr><td>".$row['Product_ID']."</td><td>".$row['Naam']."</td><td>".$row['Prijs']."</td><td>".$row['Beschrijving']."</td><td><a class='but_add' href='login.php'><i class='far fa-plus-square fa-s'></i> Add</a></td></tr>"; } } ?>
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $conn in /in/1Eb2Y on line 2 Fatal error: Uncaught Error: Call to a member function query() on null in /in/1Eb2Y:2 Stack trace: #0 {main} thrown in /in/1Eb2Y on line 2
Process exited with code 255.

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:
86.14 ms | 1614 KiB | 4 Q