Skip to content

1.6.0

Compare
Choose a tag to compare
@aboks aboks released this 02 Nov 15:32
· 60 commits to master since this release

New sniff added: Moxio.PHP.DisallowImplicitIteratorToArrayWithUseKeys. This sniff disallows calls to iterator_to_array() without the $use_keys argument being explicitly set. By default, iterator_to_array uses the keys provided by the iterator. This behavior is often desired for associative arrays, but can cause unexpected results for 'list-like' arrays. Explicitly requiring the parameter to be set ensures that the developer has to think about which behavior is desired for the situation at hand. Thanks to @hollodotme for drawing our attention to this 'risky' default behavior.