Commit 43889fa5cc8 for php.net
commit 43889fa5cc813c47358ff677a72620d97ad0fdf3
Author: Tim Düsterhus <tim@bastelstu.be>
Date: Wed Apr 29 08:03:14 2026 +0200
zend_portability: Use `[[fallthrough]]` for C23 and C++ (#21904)
diff --git a/Zend/zend_portability.h b/Zend/zend_portability.h
index 450e72a60eb..c5b5fe02929 100644
--- a/Zend/zend_portability.h
+++ b/Zend/zend_portability.h
@@ -130,7 +130,9 @@
#endif
/* pseudo fallthrough keyword; */
-#if defined(__GNUC__) && __GNUC__ >= 7
+#if __STDC_VERSION__ >= 202311L || defined(__cplusplus)
+# define ZEND_FALLTHROUGH [[fallthrough]]
+#elif defined(__GNUC__) && __GNUC__ >= 7
# define ZEND_FALLTHROUGH __attribute__((__fallthrough__))
#else
# define ZEND_FALLTHROUGH ((void)0)