I have read through multiple questions here on StackExchange that concern WordPress scaling and the common opinion is that WordPress is indeed highly scalable provided you have the infrastructure to support it. However, all opinions point and talk about the database scaling.
However, I must ask out of curiosity as to how scalable is the WordPress code? I find numerous places within the code where User IDs or Post IDs are cast as integers. Now, PHP puts limitation on range of integers to
-2147483648 to 2147483647(signed) for 32 bit and
9223372036854775807 for 64 bit. Thus limiting the code to work in that range. So if you happen to have a Post ID or a User ID of
100000000000000 it shall be converted to
2147483647 on 32 bit systems. And a similarly on 64 bit. Effectively, limiting the system.
So, though the database allows for scaling, the code limits the same. I may be entirely wrong with my assumptions, if so I'd like to be educated on the same. And if otherwise, how do we scale the code? Or are claims of WordPress scalability false? Also what are other possibilities where the code could be limiting the scalability?