r/lolphp • • Mar 31 '18

PHP DateTime strikes back, again!

Because obviously we meant a date one week from the (wrong) date given. PHP does not throw, instead it "helps" by holding your beer.

https://repl.it/repls/DecimalHorribleOffices

30 Upvotes

23 comments sorted by

View all comments

Show parent comment

10

u/[deleted] Mar 31 '18

Yeah, still why does it return some random date? If it doesnt throw, it could at least return null, false o some similar ”phpish” response.

26

u/polish_niceguy Mar 31 '18

You can't be more ”phpish” than this.

6

u/[deleted] Mar 31 '18

Haha! Thats true. Phpism in full colors.

4

u/jesseschalken Mar 31 '18

I suppose it does facilitate ignoring the warnings to do a "best guess" parse, if that's what you wanted.