Skip to content

Instantly share code, notes, and snippets.

@MegaphoneJon
Last active October 30, 2023 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MegaphoneJon/60b26e9dc2c1910970e9fb2d00ed3af5 to your computer and use it in GitHub Desktop.
Save MegaphoneJon/60b26e9dc2c1910970e9fb2d00ed3af5 to your computer and use it in GitHub Desktop.
strftime fix
diff --git a/php-8.1-strftime.php b/php-8.1-strftime.php
index 178cd5ad2a..646d93f95b 100644
--- a/php-8.1-strftime.php
+++ b/php-8.1-strftime.php
@@ -102,5 +102,10 @@
$calendar = IntlGregorianCalendar::createInstance();
$calendar->setGregorianChange(PHP_INT_MIN);
+ // AW 2023-10-29 Temporary fix for compatibility with PHP 8.1.25
+ if ($locale == 'C') {
+ $locale = 'en-US';
+ }
+
return (new IntlDateFormatter($locale, $date_type, $time_type, $tz, $calendar, $pattern))->format($timestamp);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment