3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fields = array( 'menu_id' => $menu_id[], 'menu_name' => $menu_name[], 'yes' => $yes[] ); $this->db->insert('menu_table',$fields); ?> <form action="<?php base_url('controller/insert'); ?>"> <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>
Output for 7.1.0 - 7.1.19, 7.2.0 - 7.2.8
Fatal error: Cannot use [] for reading in /in/L9var on line 3
Process exited with code 255.

preferences:
170.18 ms | 1395 KiB | 36 Q