Re:My Reality Moment. Why did I ever agree to do this?
by herge on Friday September 18, 2015 @08:41PM
(#10242842)
What does typing have anything to do with this 'feature' in the number parser? If atoi in C also parsed octal numbers, you would have had the same problem.
Your issue is with the too liberal number parser.
I noticed what seemed like random numeric errors in a random subset of RPCs. It turned out, after what seemed like eons of investigation, that some clients were stringifying decimal integers with leading zeros, which made PHP interpret them as octal numbers, and hence the random seeming errors.
Having come from a strongly-typed-language background (C/C++/Java), that was a major learning experience about the caveats of weakly typed languages.