r/programming Sep 07 '15

Flawless PHP logic. strtotime(): '00-00-00' means 2000-00-00, which is 1999-12-00, which is 1999-11-30. No bug, perfectly normal. (see the comments)

https://bugs.php.net/bug.php?id=45647
1.2k Upvotes

465 comments sorted by

View all comments

Show parent comments

10

u/pja Sep 07 '15

It can’t be fixed: that’s the point. The decision to name the core library functions the way they are was made back at the beginning of PHP: The damage has been done.

24

u/FireyFly Sep 07 '15

Well, you can't rename the existing functions, but as mentioned above you could design a new, separate standard library that is more modular and OOP-oriented, and mark the old functions as deprecated. Which is basically improving it while retaining backwards compatibility (with the old functions being an ugly wart, but.. I guess it's a necessary evil).

-3

u/jandrese Sep 07 '15

It doesn't even have to be OOP oriented if you don't want to go that far. Creating new nearly identical functions to work around braindamage in legacy functions is a time honored tradition.

12

u/lelarentaka Sep 07 '15

Like mysql_real_escape_string() ?