3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function create_pyramid($limit) { for($row = 1; $row < $limit; $row ++) { $stars = str_repeat('*', ($row - 1) * 2 + 1); $space = str_repeat(' ', $limit - $row); echo $space . $stars . '<br/>'; } } echo "<pre>" ; create_pyramid(10);
based on esGBg
Output for 4.3.0 - 7.3.0rc4
<pre> *<br/> ***<br/> *****<br/> *******<br/> *********<br/> ***********<br/> *************<br/> ***************<br/> *****************<br/>