Programming Search⌘K

PHP lints, page 2 of 2

The lint rules of PHP, with what each one finds. This page has 315 cards.

Psalm emits this issue when a reference assigned in a potentially confusing scope is reused later. ReferenceReusedFromConfusingScope

Since PHP doesn't scope loops and ifs the same way most other languages do, a common issue is the reuse of a variable declared in such a scope. Usually it doesn't matter, because a reassignment to an already-defined variable will just reassign it, but if the already-defined variable is a reference it will change the value of the referred to variable. Psalm ignores it at error level 5 and higher.

Code
ReferenceReusedFromConfusingScope

Source: github.com, psalm.dev. JSON record. This entry is a card. Help write this page.

Psalm emits this issue when Psalm encounters a reference that it is not currently able to track (for instance a reference to an array offset of an array offset: $foo = &$bar[$baz[0]]). UnsupportedReferenceUsage

When an unsupported reference is encountered, Psalm will issue this warning and treat the variable as though it wasn't actually a reference. Psalm ignores it at error level 3 and higher.

Code
UnsupportedReferenceUsage

Source: github.com, psalm.dev. JSON record. This entry is a card. Help write this page.