note 9447 deleted from function.strlen by felipe

From: Date: Tue, 22 Jul 2008 02:26:15 +0000
Subject: note 9447 deleted from function.strlen by felipe
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-142462@lists.php.net to get a copy of this message
Note Submitter: rasmus at php dot net ---- 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.

« previous php.notes (#142462) next »