This function is guaranteed to never return a negative value. This is important because we use arr[env_parse_switch(...)] in a few places.