3v4l.org

run code in 300+ PHP versions simultaneously
<?php $menu_id = $_POST['menu_id']; $menu_name = $_POST['menu_name']; $yes = $_POST['yes']; ?> <form action=""> <table> <thead> <tr> <th>Menu Id</th> <th>Menu Name</th> <th>Yes/No</th> </tr> </thead> <tbody> <?php foreach($result as $res) { ?> <tr> <td><input type="text" name="menu_id[]" value="<?= $res->menu_id ?>"></td> <td><input type="text" name="menu_name[]" value="<?= $res->menu_name ?>"></td> <td><input type="checkbox" name="yes[]" value="<?= $res->menu_id ?>"></td> </tr> <?php } ?> </tbody> </table>

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
173.35 ms | 2336 KiB | 8 Q