ID: 26477
Updated by: [EMAIL PROTECTED]
Reported By: languitar at languitarium dot de
-Status: Open
+Status: Bogus
Bug Type: Unknown/Other Function
Operating System: Linux
PHP Version: 5.0.0b2 (beta2)
New Comment:
Once the parse error in the sample script is fixed it works perfectly.
Previous Comments:
------------------------------------------------------------------------
[2003-11-30 18:50:05] languitar at languitarium dot de
class categories {
function getfolders($folderid = -1, $depth = -1) {
if($folderid == -1) {
echo "if";
} else {
echo "else";
}
}
}
$categories = new categories
$categories->getfolders(6);
the output is "ifelse" in my case.
------------------------------------------------------------------------
[2003-11-30 17:56:42] [EMAIL PROTECTED]
Please provide a COMPLETE (as short as possible) source code that can
be used to replicate the problem.
------------------------------------------------------------------------
[2003-11-30 17:14:06] languitar at languitarium dot de
This Code was used in a class. I didn't notice that the problem seems
to be connected with that fact.
------------------------------------------------------------------------
[2003-11-30 16:58:23] [EMAIL PROTECTED]
Works fine for me...:
[EMAIL PROTECTED]:~$ 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