3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tri = [1, 1]; var_export($tri); for ($x = 0; $x <= 6; ++$x) { $trinew = [1]; $tri[] = 0; for($y = 0, $count = count($tri) - 1 ; $y < $count; ++$y) { $z = $y + 1; $trinew[] = $tri[$y] + $tri[$z]; } $tri = $trinew; var_export($tri); }

preferences:
36.16 ms | 404 KiB | 5 Q