Pure statements

A statement is said to be pure if two conditions hold:

  • the result won't change because of values that are not part of the statement itself
  • the statement has no side effect

phantm will detect a subset of those pure statements, and report them. The rationale is that such statements are useless and thus could be omitted. We argue that it is often the case that statements are pure by mistake, for instance $var == 2; (== instead of =).

Note that some side effects are not taken into account. For example, the statement $undefined; could be here to trigger a custom error handler resulting in some side effects. Such non-trivial side-effects are ignored.