3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function outputListItems($char) { static $index = array('A' => 1); if (!isset($index[$char])) { $index[$char] = 1; } for ($i = 0; $i < 3; $i++) { echo '<li>'; echo $char; echo $index[$char]++; echo '<ul>'; outputListItems($char++); echo '</ul>'; echo '</li>'; } } ?> <ul> <li> A1 <ul><?php outputListItems('B'); ?></ul> </li> </ul>