Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Last revision Both sides next revision | ||
phantm:faq [2010/05/04 15:34] ekneuss |
phantm:faq [2010/05/04 15:35] ekneuss |
||
---|---|---|---|
Line 21: | Line 21: | ||
No. First of all, static analysis has its limitations. There will always be | No. First of all, static analysis has its limitations. There will always be | ||
- | false positives given the semantics of PHP. However, you can help ''phantm'' do | + | false positives given the semantics of PHP. However, you can help //phantm// do |
a better job, by precisely annotating your code. See [[phantm:annotations|Annotations]] for more | a better job, by precisely annotating your code. See [[phantm:annotations|Annotations]] for more | ||
details. | details. | ||
- | Also, you'll notice that by default ''phantm'' is quite picky about uninitialized | + | Also, you'll notice that by default //phantm// is quite picky about uninitialized |
values, or implicit type conversions. | values, or implicit type conversions. | ||
- | For instance, on the code %%$a = "2"; echo $a / 2;%%, ''phantm'' will report that | + | For instance, on the code %%$a = "2"; echo $a / 2;%%, //phantm// will report that |
%%$a%% is not a valid operand for /. Even though those "errors" are not | %%$a%% is not a valid operand for /. Even though those "errors" are not | ||
critical and PHP itself handles them gracefully in most cases, it is still | critical and PHP itself handles them gracefully in most cases, it is still | ||
- | considered "bad style" by ''phantm''. | + | considered "bad style" by //phantm//. |
==== I get errors mentioning Top or Bottom, what are those types? ==== | ==== I get errors mentioning Top or Bottom, what are those types? ==== | ||
- | ''phantm'' represents types as so-called Lattice elements. In the type Lattice, | + | //phantm// represents types as so-called Lattice elements. In the type Lattice, |
''Top'' represents the supertype of all types, and ''Bottom'' represents the | ''Top'' represents the supertype of all types, and ''Bottom'' represents the | ||
subtype of all PHP types. In short, ''Top'' means "Every possible types" | subtype of all PHP types. In short, ''Top'' means "Every possible types" | ||
Line 53: | Line 53: | ||
==== I have code that uses references, but it's not analyzed properly by phantm, why? ==== | ==== I have code that uses references, but it's not analyzed properly by phantm, why? ==== | ||
- | References are currently ignored by ''phantm''. | + | References are currently ignored by //phantm//. |
==== I get errors on my arrays, but the error itself is riddled with "..."s ? ==== | ==== I get errors on my arrays, but the error itself is riddled with "..."s ? ==== | ||
- | ''phantm'' will try to reduce the size of errors as much as possible by | + | //phantm// will try to reduce the size of errors as much as possible by |
limitting the string representation of types to the parts that are | limitting the string representation of types to the parts that are | ||
relevant for the type error. | relevant for the type error. | ||
Line 70: | Line 70: | ||
- | ==== I'm getting weird complicated types in my errors, with my unannotated code, | + | ==== I'm getting weird complicated types in my errors, with my unannotated code, why doesn't it say Any? ==== |
- | why doesn't it say Any? === | + | |
- | This is because ''phantm'' refine types used in expressions. For instance, given the code | + | This is because //phantm// refine types used in expressions. For instance, given the code |
<file> | <file> |