Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#49522 closed defect (bug) (invalid)

HHVM and date_create_immutable_from_format

Reported by: tigerloki's profile tigerloki Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.3
Component: Date/Time Keywords:
Focuses: Cc:


I have openSuSE 15.1, nginx 1.14.2, hhvm 3.30.5 and MariaDB. I install WordPress 5.3+ and a faced with a problem. Site and CP not working and get 500 error.
There's error from hhvm:

Fatal error: Uncaught Error: Call to undefined function date_create_immutable_from_format() in /srv/www/blogtest/wp-includes/general-template.php:2645
Stack trace:
#0 /srv/www/blogtest/wp-includes/general-template.php(2569): get_post_datetime()
#1 /srv/www/blogtest/wp-includes/general-template.php(2532): get_post_time()
#2 /srv/www/blogtest/wp-includes/general-template.php(2508): get_the_time()
#3 /srv/www/blogtest/wp-content/themes/twentytwenty/inc/template-tags.php(375): the_time()
#4 /srv/www/blogtest/wp-content/themes/twentytwenty/inc/template-tags.php(181): twentytwenty_get_post_meta()
#5 /srv/www/blogtest/wp-content/themes/twentytwenty/template-parts/entry-header.php(70): twentytwenty_the_post_meta()
#6 /srv/www/blogtest/wp-includes/template.php(724): include()
#7 /srv/www/blogtest/wp-includes/template.php(671): load_template()
#8 /srv/www/blogtest/wp-includes/general-template.php(168): locate_template()
#9 /srv/www/blogtest/wp-content/themes/twentytwenty/template-parts/content.php(20): get_template_part()
#10 /srv/www/blogtest/wp-includes/template.php(724): include()
#11 /srv/www/blogtest/wp-includes/template.php(671): load_template()
#12 /srv/www/blogtest/wp-includes/general-template.php(168): locate_template()
#13 /srv/www/blogtest/wp-content/themes/twentytwenty/index.php(88): get_template_part()
#14 /srv/www/blogtest/wp-includes/template-loader.php(98): include()
#15 /srv/www/blogtest/wp-blog-header.php(19): include()
#16 /srv/www/blogtest/index.php(17): include()
#17 {main}

After some examination I found out what the problem is. It's new function get_post_datetime. I don't why but date_create_immutable_from_format method don't work. I try to use date_create_from_format or DateTimeImmutable::createFromFormat() and it worked.

Change History (2)

#1 @SergeyBiryukov
4 years ago

Hi there, welcome to WordPress Trac! Thanks for the report.

Just noting that support for HHVM was dropped in 2017 via ticket #40548.

#2 @Rarst
4 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

The function was introduced in PHP 5.5, WordPress 5.2+ requires PHP 5.6+.

I have trouble figuring out if any HHVM version reached parity with 5.6 specifically, WikiPedia says it was initially based on PHP 5.4 spec.

In general HHVM 3.30 was last long term support version to run PHP at all (4.0+ only supports Hack) and its end of life apparently was November 2019

I would say at this point WordPress core is both officially and de-facto incompatible with running on HHVM.

Note: See TracTickets for help on using tickets.