Break in PHP
Each case is closed with the break instruction that, when executed, immediately causes us to exit the execution of the switch; if that break was not at the end of each case, once a true case was found and its sentences were executed, the questions of the other cases would continue to be unnecessarily executed, losing time without necessity.
Break in PHP (exit the switch)
Each case is closed with the break instruction that, when executed, immediately causes us to exit the execution of the switch; if that break was not at the end of each case, once a true case was found and its sentences were executed, the questions of the other cases would continue to be unnecessarily executed, losing time unnecessarily.
But what is worse, the default would be executed (which would not have to be executed if a true case was already executed, remember that the default is that it is executed only if all the cases were false).
Now that we know the conditional (if, else, elseif) and selective (switch) structures, we will deepen the complementary tools of these structures, which will allow us to validate the data of our forms with the greatest precision. The main complementary tools are the comparison operators and the logical operators, which we will learn next.
ChatGPT Free
Ask questions on any topic
CITE ARTICLE
For homework, research, thesis, books, magazines, blogs or academic articles
APA Format Reference:
Delgado, Hugo. (2019).
Break in PHP.
Retrieved Nov 05, 2024, from
https://disenowebakus.net/en/break-php