Last active
August 19, 2021 11:49
-
-
Save tadeubdev/08d933ee4539d05a9a88f82f34f349ba 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 | |
| $valor = ''; | |
| if (empty($valor)) { | |
| echo 'Sim! Estou vazio!' . PHP_EOL; | |
| } | |
| if (isset($valor)) { | |
| echo 'Sim! Eu existo na memória!' . PHP_EOL; | |
| } | |
| $valor = null; | |
| if (empty($valor)) { | |
| echo 'Sim! Estou vazio novamente!' . PHP_EOL; | |
| } | |
| if (isset($valor)) { | |
| echo 'Ops! Eu não vou entrar aqui!'; | |
| } | |
| // printa: | |
| // | |
| // Sim! Estou vazio! | |
| // Sim! Eu existo na memória! | |
| // Sim! Estou vazio novamente! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment