Closed jarseneault closed 7 years ago
Thank You for this bug fix :+1:
I ran into this same issue when trying to learn how to use the library. Very confusing and thought I was just using it wrong as US appeared to be in the code. Any reason this hasn't been merged in?
Thanks!
Thank You for this fix!!
Author appears to be unreachable. Closing.
The demo.php code, if run for a US phone number with a US region, fails with
because of the following line in PhoneNumberUtil::init:
The array_search returns false, which is coerced to 0 for the unset, which happens to correspond to the US region.
The attached commit prevents this behavior, but I'm not sure what you were trying to do here. My guess is that you were attempting to check against countryCallingCodeToRegionCodeMap instead of supportedRegions. If so, feel free to change. Thanks! Please let me know if I was misunderstanding something.