As yet another variation, 30 years ago, I lived in a rural area of the US where the population was small enough that, to make calls within the local exchange, you only had to dial the last four digits of the number. I assume that sort of thing is still around.
And there are obviously rules about which digits can be used and in what sequence, since that's the only way the phone switching system can determine when you've dialed the complete number, so not even every 7- or 10-digit number is a potential phone number. For example, 123-4567 can't be a valid phone number in the US because the leading '1' indicates that you're calling a non-local number.