3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php echo "<table>"; for($k=0;$k<7;$k++){ // k goes from 0-7 echo "<tr>"; for($j=0;$j<$num_cols;$j++){ // j goes from 0-19 echo "<td>" . $data_array['col_'.$j][$k] . "</td>"; if ($j > 0 and $k > 0) {$teamtotal = $teamtotal + $data_array['col_'.$j][$k];} } if ($k==0) {echo "<td>Total</td>";} echo "<td>" . $teamtotal . "</td></tr>"; $teamtotal = 0; } echo "</table>";
Output for 5.0.4 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
<table><tr> Notice: Undefined variable: num_cols in /in/TJni1 on line 5 <td>Total</td> Notice: Undefined variable: teamtotal in /in/TJni1 on line 10 <td></td></tr><tr> Notice: Undefined variable: num_cols in /in/TJni1 on line 5 <td>0</td></tr><tr> Notice: Undefined variable: num_cols in /in/TJni1 on line 5 <td>0</td></tr><tr> Notice: Undefined variable: num_cols in /in/TJni1 on line 5 <td>0</td></tr><tr> Notice: Undefined variable: num_cols in /in/TJni1 on line 5 <td>0</td></tr><tr> Notice: Undefined variable: num_cols in /in/TJni1 on line 5 <td>0</td></tr><tr> Notice: Undefined variable: num_cols in /in/TJni1 on line 5 <td>0</td></tr></table>
Output for 4.3.0 - 5.0.3
<table><tr> Notice: Undefined variable: num_cols in /in/TJni1 on line 5 <td>Total</td> Notice: Undefined variable: teamtotal in /in/TJni1 on line 10 <td></td></tr><tr> Notice: Undefined variable: num_cols in /in/TJni1 on line 5 <td>0</td></tr><tr> Notice: Undefined variable: num_cols in /in/TJni1 on line 5 <td>0</td></tr><tr> Notice: Undefined variable: num_cols in /in/TJni1 on line 5 <td>0</td></tr><tr> Notice: Undefined variable: num_cols in /in/TJni1 on line 5 <td>0</td></tr><tr> Notice: Undefined variable: num_cols in /in/TJni1 on line 5 <td>0</td></tr><tr> Notice: Undefined variable: num_cols in /in/TJni1 on line 5 <td>0</td></tr></table>