Last active
August 7, 2021 12:51
-
-
Save tadeubdev/7c6ad25634e9978dab09ee3d78058a41 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $value = 1; | |
| // retorna true, pois o value é igual a 1 e menor que 2 | |
| if ($value === 1 and $value < 2) { | |
| // code | |
| } | |
| // retorna true, o value não é igual a 2, mas é menor que 2 | |
| // ele entra na segunda expressão | |
| if ($value === 2 or $value < 2) { | |
| } | |
| // lembrando que também poderia ser usado o && e ||, daria no mesmo | |
| if ($value === 1 && $value < 2) { | |
| // code | |
| } | |
| if ($value === 2 || $value < 2) { | |
| // code | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment