#26477 [Opn]: Problems with negative Integers in If-Clauses

From: Date: Sun, 30 Nov 2003 22:14:07 +0000
Subject: #26477 [Opn]: Problems with negative Integers in If-Clauses
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-51399@lists.php.net to get a copy of this message
ID: 26477 User updated by: languitar at languitarium dot de Reported By: languitar at languitarium dot de Status: Open Bug Type: Unknown/Other Function Operating System: Linux PHP Version: 5.0.0b2 (beta2) New Comment: This Code was used in a class. I didn't notice that the problem seems to be connected with that fact. Previous Comments: ------------------------------------------------------------------------ [2003-11-30 16:58:23] derick@php.net Works fine for me...: derick@kossu:~$ php-5.0dev <?php $x = -1; if($x == -1){ echo "if"; } else { echo "else"; } ?> if ------------------------------------------------------------------------ [2003-11-30 16:56:26] languitar at languitarium dot de Description: ------------ PHP 5 beta 2 seems to do strange things when using a comaprisson wiht negative values in an If-clause. Sometimes the if-part will work as well as the else-part and sometimes the if-part will be used two times. Reproduce code: --------------- $x = -1; if($x == -1){ echo "if"; } else { echo "else"; } Expected result: ---------------- if Actual result: -------------- ifif ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=26477&edit=1

« previous php.bugs (#51399) next »