3v4l.org

run code in 300+ PHP versions simultaneously
<?php $bill= 0; $sno = 1; foreach($_SESSION as $products){ //print_r($products); echo "<tr> <form action='edit_cart.php' method='post'>"; if (!$products) $products = array(); foreach($products as $key =>$value){ if($key == 0){ echo "<input type='hidden' name='name$key' class='form-control' value='".$value."'> <td>".$value."</td>"; } else if($key == 1){ $p = $value; echo "<input type='hidden' name='name$key' class='form-control' value='".$value."'> <td>".$value."</td>"; }else if($key == 2){ $q = $value; $bill = ($p * $q); echo "<td><input type='number' name='name$key' class='form-control col-xl-4 text-center' min='1' value='".$value."'></td> <td>".($bill)."</td> <td><input type='submit' name='event' value='Update' class='btn btn-sm btn-warning'></td> <td><input type='submit' name='event' value='Delete' class='btn btn-sm btn-danger'></td>"; } } echo "</form> </tr>"; } echo "</table> </div>"; ?>
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined global variable $_SESSION in /in/SBDRU on line 4 Warning: foreach() argument must be of type array|object, null given in /in/SBDRU on line 4 </table> </div>

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:
100.89 ms | 1413 KiB | 4 Q