Skip to content

Version 2.4: Strict checks

Choose a tag to compare

@FireMidge FireMidge released this 20 Jul 11:13
· 3 commits to master since this release
404f4ea

What's changed?

Change: isEqualTo and isNotEqualTo on IsIntStringMapType default to using a strict check, which means the item to compare it to must be of the same class. If you do not want a strict check to happen, you can continue to pass false for the $strictCheck parameter.

Change: isEqualTo and isNotEqualTo on IsCollectionType (which affects all array types) have a new $strictCheck parameter, defaulting to true. When it is true, the item to compare to must be of the same class. If you do not want a strict check to happen, you can pass false for the $strictCheck parameter.

It is best practice to be as strict as possible with checks to avoid comparing values you did not mean to compare, and encounter unexpected behaviour as a result.