A Case Of Misplaced Parenthesis¶
<?php
// suspicious and legit
if (in_array($a, $b, $c === true)) {}
// could it be this one?
if (in_array($a, $b, $c) === true) {}
The closing parenthesis of the in_array() call may be misplaced, yet yield a valid PHP code, and even, a valid business case. This all depends on the actual value given to the $c variable.
It is most probably a bug, given the number of arguments in in_array().
See Also¶
PHP Features¶
Last updated: 14 July 2026