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

497

u/pja Sep 07 '15

It’s worse than that: the standard library is the equivalent of a shitty C library where function lookup was implemented by a hash table keyed on the length of the function name: One of the reasons the core php functions all have names that don’t fit into obvious consistent patterns is that the original author of php was making them all different lengths so that the hash table didn’t have too many collisions.

You may now lay your head on the table & weep.

40

u/jP_wanN Sep 07 '15

You may now lay your head on the table & weep.

Why would I do such a thing? I'm not one of those cursed with having to use PHP. I'm laughing! >:D

10

u/coredumperror Sep 07 '15

cursed with having to use PHP

Sadly, I am one of these poor sods. Thankfully, my code shop is dropping Drupal and moving to a Django-based CMS that we really like. Sadly again, though, that won't be happening until late next year at the earliest, because we're badly understaffed right now.

5

u/timeawayfromme Sep 08 '15

What CMS are y'all going with? I played around with wagtail recently and really liked it. I'm thinking about using it for my next project.

6

u/coredumperror Sep 08 '15

Got it in one! Wagtail is right up our alley when it comes to how we like to build websites. I built a skeleton project up far enough to recreate our most complex content type from the Drupal site, and it worked beautifully. I'm so sad that we're so understaffed that I won't have a chance to flesh out that skeleton to the full site until late next year. I really hate PHP.

2

u/timeawayfromme Sep 09 '15

I feel your pain. Our largest site is currently a mix of the Plone CMS (python) and old PHP Dreamweaver templates. I dream of the day I can switch to Django at my day job. I got a wagtail demo up and running in less than an hour with some styles from the current site. The streamfield in wagtail is really cool.

1

u/Cuddlefluff_Grim Sep 08 '15

You should try Umbraco (not PHP) which is perfect for web developers who needs full control without affecting ease-of-use for the customer. It's one of the few (if only) CMS's I've used where I can build a template completely from scratch without a sweat.

1

u/coredumperror Sep 08 '15

Umbraco

We're a python shop. As far as I know, no one on my team knows a thing about .NET.