Make WordPress Core

Opened 6 years ago

Last modified 2 years ago

#22194 assigned defect (bug)

PHP x64 compatibility issue with date values

Reported by: Whissi Owned by: pento
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Date/Time Keywords: dev-feedback needs-patch
Focuses: Cc:



seems like WordPress is using the "0000-00-00 00:00:00" value as magic value for date values, which aren't set instead of NULL.

This is working fine for any PHP x86 builds, because the magic value is also an invalid date.

But PHP x64 builds support this value. It is no longer invalid. It is now a valid date! This will result in problems, because some functions are expecting that parsing this date will return false, but now on x64 systems they won't get an invalid date, when they are expecting one.

So the problem is, that WordPress is using a valid date as magic value for an invalid date aka default value.

Fixing this issue will require a SQL schema change and to update all the code, checking for "0000-00-00 00:00:00"...

For references, see ticket #21987 and https://bugs.php.net/bug.php?id=53662

Change History (3)

#1 @SergeyBiryukov
6 years ago

  • Component changed from General to Date/Time

#2 @chriscct7
3 years ago

  • Keywords dev-feedback needs-patch added
  • Owner set to pento
  • Severity changed from major to normal
  • Status changed from new to assigned

#3 @pbearne
2 years ago

yes is going to touch a lot of code

Are we going to "fix" the schema and set null for no date?


test for 64bit system and then look for ????

strtotime("0000-00-00 00:00:00") returns FALSE on a 32 bit system. strtotime("0000-00-00 00:00:00") returns -62169955200 on a 64 bit system.

Note: See TracTickets for help on using tickets.