<?php $i = 1;$posts = range(10, 20);foreach ($posts as $post){ echo $i++, PHP_EOL; if($i == 8){ break; }}
Standard input is empty
1 2 3 4 5 6 7
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!