I'm using a sleep function inside of a foreach loop and I'd like to echo the value inside the loop. Why isn't this working? The $test var inside the loop never changes from 0.
foreach($test as $val){
ob_start();
echo $test++;
sleep(1);
ob_end_flush();
}