Use strict method for the in_array() check.

Created on 26 November 2020, almost 4 years ago
Updated 6 March 2024, 6 months ago

Problem/Motivation

Using an in_array function without a third parameter may cause unexpected behavior. You may see unexpected results here
I had the issue when in_array('en', ['en' => 0, 'fr' => 0]) check returned TRUE when the expected result was FALSE, adding a strict parameter resolves this issue.

πŸ“Œ Task
Status

Closed: works as designed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine alt.dev

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024