Syntaxe while

Tout comme pour if...endif , la syntaxe des boucles while...endwhile a changée :

Exemple F.7. Migration : ancienne syntaxe while...endwhile

<?php
while ( $more_to_come );
    
//...
endwhile;
?>

Exemple F.8. Migration : nouvelle syntaxe while...endwhile

<?php
while ( $more_to_come ):
    ...
endwhile;
?>

AVERTISSEMENT

Attention : si vous utilisez la vieille syntaxe while...endwhile en PHP 3.0, vous obtiendrez une boucle sans fin !