3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // ZADANIE 1 echo "<table border='1'>"; for ($i=1;$i<=10;$i++) { echo "<tr>"; for ($j=1;$j<=10;$j++) { echo "<td>"; $tab[$i][$j]=$i*$j; echo $tab[$i][$j]; echo "</td>"; } echo "</tr>"; } echo "</table><br><br>"; // ZADANIE 2 $tab[0]['imie']= "Jan"; $tab[0]['nazwisko']= "Nowak"; $tab[1]['imie']= "Kamil"; $tab[1]['nazwisko']= "Kwiecien"; $x = $tab[0]['imie']; $y = $tab[0]['nazwisko']; $imie = substr("$x",0,1); $nazwisko = substr("$y",0,1); echo $imie." ".$nazwisko."<br>"; $x = $tab[1]['imie']; $y = $tab[1]['nazwisko']; $imie = substr("$x",0,1); $nazwisko = substr("$y",0,1); echo $imie." ".$nazwisko."<br><br>"; // ZADANIE 3 $a[]=array(3,5,7); $a[]=array(2,1,4); $b[]=array(5,3); $b[]=array(8,2); $b[]=array(4,3); $z[0] = $a[0][0]*$b[0][0]+ $a[0][1]*$b[1][0]+ $a[0][2]*$b[2][0]; $z[1] = $a[0][0]*$b[0][1]+ $a[0][1]*$b[1][1]+ $a[0][2]*$b[2][1]; $z[2] = $a[1][0]*$b[0][0]+ $a[1][1]*$b[1][0]+ $a[1][2]*$b[2][0]; $z[3] = $a[1][0]*$b[0][1]+ $a[1][1]*$b[1][1]+ $a[1][2]*$b[2][1]; $wynik = $z[0]*$z[2]+$z[1]*$z[3]; echo $wynik; ?>
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
<table border='1'><tr><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td><td>7</td><td>8</td><td>9</td><td>10</td></tr><tr><td>2</td><td>4</td><td>6</td><td>8</td><td>10</td><td>12</td><td>14</td><td>16</td><td>18</td><td>20</td></tr><tr><td>3</td><td>6</td><td>9</td><td>12</td><td>15</td><td>18</td><td>21</td><td>24</td><td>27</td><td>30</td></tr><tr><td>4</td><td>8</td><td>12</td><td>16</td><td>20</td><td>24</td><td>28</td><td>32</td><td>36</td><td>40</td></tr><tr><td>5</td><td>10</td><td>15</td><td>20</td><td>25</td><td>30</td><td>35</td><td>40</td><td>45</td><td>50</td></tr><tr><td>6</td><td>12</td><td>18</td><td>24</td><td>30</td><td>36</td><td>42</td><td>48</td><td>54</td><td>60</td></tr><tr><td>7</td><td>14</td><td>21</td><td>28</td><td>35</td><td>42</td><td>49</td><td>56</td><td>63</td><td>70</td></tr><tr><td>8</td><td>16</td><td>24</td><td>32</td><td>40</td><td>48</td><td>56</td><td>64</td><td>72</td><td>80</td></tr><tr><td>9</td><td>18</td><td>27</td><td>36</td><td>45</td><td>54</td><td>63</td><td>72</td><td>81</td><td>90</td></tr><tr><td>10</td><td>20</td><td>30</td><td>40</td><td>50</td><td>60</td><td>70</td><td>80</td><td>90</td><td>100</td></tr></table><br><br>J N<br>K K<br><br>3622