[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kdevelop-bugs
Subject:    [Bug 305341] New: function type hinting is wrong with boolean expressions
From:       Tim Climis <tim.climis () gmail ! com>
Date:       2012-08-17 16:55:42
Message-ID: bug-305341-40295 () http ! bugs ! kde ! org/
[Download RAW message or body]

https://bugs.kde.org/show_bug.cgi?id=305341

            Bug ID: 305341
          Severity: minor
           Version: 4.3.1
          Priority: NOR
          Assignee: kdevelop-bugs@kdevelop.org
           Summary: function type hinting is wrong with boolean
                    expressions
    Classification: Unclassified
                OS: Linux
          Reporter: tim.climis@gmail.com
          Hardware: Gentoo Packages
            Status: UNCONFIRMED
         Component: Language Support: PHP
           Product: kdevelop

This is sort of related to Bug 257465.  When you hover over a function in PHP,
it attempts to guess the return type and parameter types of the function.  For
the most part it does a pretty good job, but there's an oddity with booleans.

For example, if you use this code, it will correctly guess that the function
returns a boolean:
function foo() {
    $success = true;
    return $success;
}

But, if you instead do this, it will guess that the function returns an
integer.
function bar() {
    $success = (strlen('blah') > 0);
    return $success;
}

At first I thought that perhaps this a was a quirk of PHP - that comparisons
actually returned 0 or 1, rather than true or false values.  But looking at the
PHP documentation, that does not seem to be the case, so I think it's a bug in
KDevelop.

Reproducible: Always

-- 
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
KDevelop-bugs mailing list
KDevelop-bugs@kdevelop.org
https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-bugs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic