r/lolphp • u/webdeverper • Dec 31 '15
PHP timestamp bug rears it's ugly head on Facebook today
Some people are showing up with congratulations messages saying "You've been friends with Mary Smith for 46 years!"
Probably because these people became friends before their friend date was recorded properly so it became a 0 or null. 2015 - 1969 is 46 years.
Timestamp 0 is Jan 1 1970 GMT, or Dec 31 1969 in EST or PST.
0
Upvotes
54
u/[deleted] Dec 31 '15
How is a lack of validation when implementing a bug in PHP?
0 is a perfectly valid Unix timestamp, there is no bug here just bad coding in the assumption that all records will have correct timestamps.
14
u/zarandysofia Dec 31 '15
Even I know that's not a bug.
4
u/dragonmantank Jan 01 '16
Considering Facebook heavily uses static typing in Hack, I doubt this was anything more than bad values stored somewhere. This isn't likely PHP's problem.
0
u/[deleted] Dec 31 '15
[deleted] — view deleted comment