In PHP, you can generate an infinite loop with while
simply by passing the true
parameter.
Example:
while (true) {
echo "Ao infinito e além";
}
It is also possible to generate this through for
, simply omitting the parameters, passing the ;
.
Example:
for(;;) {
echo "Não lembro o desenho que usa a frase acima";
}
Is there any functional difference between the two?
Does the performance change?
Is there any advantage and disadvantage between one and another?