I am writing a script to make chunks of a text and send it via SMS. Earlier today i was reviewing some code to split the string in chunks and i saw something I’ve never seen before. I’m talking about the “;” right after the “}” at the en of the snippet.
Why this colon? i know it works but i don’t know if it adds some semantics or some instruction to the interpreter, anybody know what is this for?
while(1)
{
$length = (strlen($output)+strlen($words[$i]));
if($length>$new_max)
{
if(count($words) > 0)
{
$out_array[] = $output;
$output = '';
}
else
{
break;
}
}
else
{
$output = $output." ".$words[$i];
++$i;
};
};
EDIT: Looks clear that the semicolons as well as multiple semicolons together has no effect over the result, but, do you know if it has some effect to the interpreter? is it doing some task (internally) when it parses it?
I think that those 2 semicolons do nothing here. It is probably being interpreted as an empty expression immediately following the
if/while.