Last active
August 7, 2021 12:51
-
-
Save tadeubdev/169f7a66fb846a4e40f82d739069459e 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 false, pois as duas expressões são verdadeiras | |
| // value é igual a 1 e value é menor que 2 | |
| if ($value === 1 xor $value < 2) { | |
| // code | |
| } | |
| // retorna true, pois a primeira expressão é negativa | |
| // e a segunda positiva | |
| if ($value === 2 xor $value < 2) { | |
| // code | |
| } | |
| // assim como o or e o and, | |
| // você também pode utilizar o acento círcunflexo (^) | |
| 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