sequence icon indicating copy to clipboard operation
sequence copied to clipboard

in_array should probably be strict

Open shampine opened this issue 9 months ago • 0 comments

Both in_array(...$this->excludeWhenEmpty) and in_array(...$this->excludeWhenNull) omit the strict flag.

If you ever had numeric-ish keys, or someone passes integers, PHP can do weird comparisons. Safer:

in_array($snakeCasePropertyName, $this->excludeWhenEmpty, true)

shampine avatar Feb 13 '26 05:02 shampine