This bit of code works just fine in PHP:
$tmp=0;
$s="blah";
while($c=$s[$tmp++]) { echo $c; }
Depending on your warning level you may get a warning when $tmp =
4 because you have gone beyond the end of the string. If you don't care
about this warning either change your warning level or simply swallow it
using:
$tmp=0; $s="blah";
while(@$c=$s[$tmp++])
{ echo $c; }
The @ in front of the assignment will swallow any
warnings from that assignment.