Good afternoon, I used an online host with php 7 and I had the following syntax
if(!saber_se_não_existe) {}
It has always worked as well as well
if(saber_se_existe) {}
So, I have refactored my entire code by replacing EMPTY and ISSET with this show, but today I was running PHP on localhost and this does not work, I needed to change everything to! empty or empty and PHP is also 7. does this allow any extension? If so, can you tell me which one? I in localhost I used PHPDESKTOP both 47 and 53 give the same error but not online.
edit
I have an IF condition that checks if a variable has been set that in case the isset is used and to know if the empty is empty, that is
$existe = true;
$nao_existe = false;
Logo
if(empty($existe)) {
// não mostra pois existe
}
and
if(isset($nao_existe)) {
// mostra pois existe, mesmo estando vazia
}
Just as I can use
unset(variavel_com_ou_sem_valor);
$varialvel_com_ou_sem_valor ? false : true;
There are many ways to do it, so much so that I discovered the example above, that just do
if($variavel_com_ou_sem_valor) {
// se tem mostra
}
and
if(!$variavel_com_ou_sem_valor) {
// se não tem mostra
}
But this, however, my online server, both in an android emulator and an internernet shared, work the latter, but in my localhost with PHPDESKTOP da
undefined index