|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-11-30 16:56 UTC] 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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 18 09:00:01 2025 UTC |
Works fine for me...: derick@kossu:~$ php-5.0dev <?php $x = -1; if($x == -1){ echo "if"; } else { echo "else"; } ?> ifclass 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.