3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $txt = ''; for ( $i=0; $i<=5; $i++ ) { $txt = ($i<2) ? ((0===$i) ? $starNum=$i : ($starNum=$i) . ' & ' . ($i+1)) : (($starNum=$i)+1) . ' & ' . ($i+2); echo 'Starnum: '.$starNum.' - '.$txt."\n"; }
based on 7kmTd
Output for 5.6.0 - 5.6.30, hhvm-3.18.5 - 3.22.0, 7.1.0 - 7.3.0rc2
Starnum: 0 - 0 Starnum: 1 - 1 & 2 Starnum: 2 - 3 & 4 Starnum: 3 - 4 & 5 Starnum: 4 - 5 & 6 Starnum: 5 - 6 & 7