I had this happen to me yesterday in spite of knowing about it because I was rushing. I added phone numbers as array keys to deduplicate the whole set. Some ended up as ints and some as strings.
PHP arrays are the most versatile part of the language. They're what actually makes the language so good in so many ways.
But typed arrays are a freaking requirement at this point and I've been screaming about it for years now... alas no response.