The rules for coercion when doing a comparison where the RHS is an int are complicated and it's not sufficient to just do straight casts on $value
?arraykey $first_truthy = NULL,
Instead, we need to do some data tracking to convert the input to specifics values to match specific cases under different circumstances.
arraykey instead of int second arg courtesy of non-transparent enums
?arraykey $first_truthy = NULL