File php-fix-newer-versions-icu.patch of Package php8

diff -purN a/build/php.m4 b/build/php.m4
--- a/build/php.m4	2023-08-03 19:13:08.000000000 +0200
+++ b/build/php.m4	2024-05-30 21:50:19.455364516 +0200
@@ -1890,9 +1890,8 @@ AC_DEFUN([PHP_SETUP_ICU],[
   ICU_CFLAGS="$ICU_CFLAGS -DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1"
   ICU_CXXFLAGS="$ICU_CXXFLAGS -DUNISTR_FROM_CHAR_EXPLICIT=explicit -DUNISTR_FROM_STRING_EXPLICIT=explicit"
 
-  if test "$PKG_CONFIG icu-io --atleast-version=60"; then
-    ICU_CFLAGS="$ICU_CFLAGS -DU_HIDE_OBSOLETE_UTF_OLD_H=1"
-  fi
+  AS_IF([$PKG_CONFIG icu-io --atleast-version=60],
+    [ICU_CFLAGS="$ICU_CFLAGS -DU_HIDE_OBSOLETE_UTF_OLD_H=1"])
 ])
 
 dnl
diff -purN a/ext/intl/config.m4 b/ext/intl/config.m4
--- a/ext/intl/config.m4	2023-08-03 19:13:08.000000000 +0200
+++ b/ext/intl/config.m4	2024-05-30 21:51:34.928855975 +0200
@@ -83,7 +83,16 @@ if test "$PHP_INTL" != "no"; then
     breakiterator/codepointiterator_methods.cpp"
 
   PHP_REQUIRE_CXX()
-  PHP_CXX_COMPILE_STDCXX(11, mandatory, PHP_INTL_STDCXX)
+
+  AC_MSG_CHECKING([if intl requires -std=gnu++17])
+  AS_IF([$PKG_CONFIG icu-uc --atleast-version=74],[
+    AC_MSG_RESULT([yes])
+    PHP_CXX_COMPILE_STDCXX(17, mandatory, PHP_INTL_STDCXX)
+  ],[
+    AC_MSG_RESULT([no])
+    PHP_CXX_COMPILE_STDCXX(11, mandatory, PHP_INTL_STDCXX)
+  ])
+
   PHP_INTL_CXX_FLAGS="$INTL_COMMON_FLAGS $PHP_INTL_STDCXX $ICU_CXXFLAGS"
   case $host_alias in
   *cygwin*) PHP_INTL_CXX_FLAGS="$PHP_INTL_CXX_FLAGS -D_POSIX_C_SOURCE=200809L"