In the NANP only 8XX numbers are toll-free as stated in the perldoc. However the regex used in the implementation matches a superset of what it should. Specifically, it erroneously matches any number that starts "+18" and then contains any 2 of the digits "045678" (not necessarily the same digit).
That means numbers like "+1808xxxxxxx" are considered toll-free by this library when they are not. I've extracted the regex to demonstrate this:
Referring to the following:
https://github.com/DrHyde/perl-modules-Number-Phone/blob/d921df1bb7527fd4650cc1a58236f2e4a6d34834/lib/Number/Phone/NANP.pm#L303-L313
In the NANP only 8XX numbers are toll-free as stated in the perldoc. However the regex used in the implementation matches a superset of what it should. Specifically, it erroneously matches any number that starts "+18" and then contains any 2 of the digits "045678" (not necessarily the same digit).
That means numbers like "+1808xxxxxxx" are considered toll-free by this library when they are not. I've extracted the regex to demonstrate this:
In addition a new toll-free prefix "833" has been added which the regex does not currently cover.
https://en.wikipedia.org/wiki/Toll-free_telephone_number#United_States
There is potential for other prefixes in the future. So these should be checked regularly.
I'll put together an PR to address these issues.