The reason for all this is in the manual
The type of a variable is usually not set by the programmer; rather, it is decided at runtime by PHP depending on the context in which that variable is used.
Silent type conversion can kill you in both mysql and php.
Personally, I'd not allow an all numbers password, but that is just me.