8
ace48
6y

Refactoring/cleaning old code.. Found this gem:

$hour = substr($obj->hour, 0, - 3);

Turns out, hour was saved in the database as a TIME field(DATE was saved in another column) , and the previous genius dev was trying to output time in a H:i format...

No wonder php has such a bad reputation...

Comments
  • 4
    In before the “its php’s fault for allowing that in the first place” police.

    No, just some devs should be shot on sight and entire code base deleted and purged from existence.
  • 2
    @C0D4 In this scenario, I think this stupidity can be done in almost all languages..
Add Comment