3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<html> <head> <meta charset="utf-8"> <title></title> </head> <body> Распределение Бернулли (биномиальное)<br> <?php $n = 15; $p = 0.6; echo "n = $n, p = $p<br>"; echo "B($n, $p)"; echo "<table><tbody>"; for($i = 0 ; $i <= $n; $i++){ ?> <tr><td rowspan="2">p<sub><?php echo $i;?></sub> = C<sub><?php echo $n;?></sub> <sup><?php echo $i;?></sup> p<sup><?php echo $i;?></sup> q<sup><?php echo ($n-$i);?></sup> =</td><?php if(!$i){ echo '<td rowspan="2">1'; } elseif($i <= $n/2){ echo "<td>"; for($j = 1; $j < $i; $j++ ): echo $n+1-$j."&middot;"; endfor; echo ($n+1-$i); } else { echo '<td rowspan="2">C<sub>'.$n."</sub><sup>".($n-$i)."</sup>"; } ?> </td><td rowspan="2"> &middot;(<?php echo $p;?>)<sup><?php echo $i;?></sup> &middot;(<?php echo 1-$p;?>)<sup><?php echo $n-$i; ?></sup> = <?php echo C($n,$i)."&middot;(".$p.")<sup>".$i."</sup>&middot; (".(1-$p).")<sup>".($n-$i)."</sup> = "; echo number_format(B($n, $p, $i), 5)."</td></tr>"; if($i && $i <= $n/2): echo "<tr><td>"; for($j = 1; $j < $i; $j++): echo $j."&middot;"; endfor; echo "$i</td></tr>"; endif; } echo "</tbody></table>"; ?> </body> </html>
Output for 7.0.0 - 7.2.0
<html> <head> <meta charset="utf-8"> <title></title> </head> <body> Распределение Бернулли (биномиальное)<br> n = 15, p = 0.6<br>B(15, 0.6)<table><tbody> <tr><td rowspan="2">p<sub>0</sub> = C<sub>15</sub> <sup>0</sup> p<sup>0</sup> q<sup>15</sup> =</td><td rowspan="2">1 </td><td rowspan="2"> &middot;(0.6)<sup>0</sup> &middot;(0.4)<sup>15</sup> = Fatal error: Uncaught Error: Call to undefined function C() in /in/hWF6j:32 Stack trace: #0 {main} thrown in /in/hWF6j on line 32
Process exited with code 255.
Output for 5.3.20 - 5.6.28
<html> <head> <meta charset="utf-8"> <title></title> </head> <body> Распределение Бернулли (биномиальное)<br> n = 15, p = 0.6<br>B(15, 0.6)<table><tbody> <tr><td rowspan="2">p<sub>0</sub> = C<sub>15</sub> <sup>0</sup> p<sup>0</sup> q<sup>15</sup> =</td><td rowspan="2">1 </td><td rowspan="2"> &middot;(0.6)<sup>0</sup> &middot;(0.4)<sup>15</sup> = Fatal error: Call to undefined function C() in /in/hWF6j on line 32
Process exited with code 255.