#23088 [Opn->Bgs]: 'if' 'else' has a strange behavior.

From: Date: Mon, 07 Apr 2003 23:03:56 +0000
Subject: #23088 [Opn->Bgs]: 'if' 'else' has a strange behavior.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-37309@lists.php.net to get a copy of this message
ID: 23088 Updated by: sniper@php.net Reported By: batera at linux dot ime dot usp dot br -Status: Open +Status: Bogus -Bug Type: Output Control +Bug Type: *General Issues Operating System: Slackware Linux PHP Version: 4.3.2RC1 New Comment: Not enough information was provided for us to be able to handle this bug. Please re-read the instructions at http://bugs.php.net/how-to-report.php If you can provide more information, feel free to add it to this bug and change the status back to "Open". Thank you for your interest in PHP. ..and doesn't really look like any bug, just misunderstanding about how things work.. Previous Comments: ------------------------------------------------------------------------ [2003-04-07 12:03:09] jlg at huelladigital dot net You have a syntax error in your script. It says: if (!isset($usuario) OR $usuario != $login (...) ^^ It should say: if (!isset($usuario) OR $usuario !== $login (...) ^^^ ------------------------------------------------------------------------ [2003-04-07 08:06:36] batera at linux dot ime dot usp dot br The best whay to show you my problem is send you my example. This expression works as expected: <? if (!isset($usuario) OR $usuario != $login OR $usuario == 'logoff' OR $user_senha != $senha OR $user_senha == 'null') { echo "okokok"; } else echo "corrigido!"; ?> but, when I remove the 'else', 'if', tha in first was false, become true. <? if (!isset($usuario) OR $usuario != $login OR $usuario == 'logoff' OR $user_senha != $senha OR $user_senha == 'null') { echo "ppp"; } ?> I'll go back to php 3.1 'cause I need it working. Please, let me know when this bug is fixed. tx a lot. you allways have done a grate job! best wishes OgRo ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=23088&edit=1

« previous php.bugs (#37309) next »