From c03215b62325148fb342cec5fea897bc9e5c202c Mon Sep 17 00:00:00 2001 From: Theodore Brown Date: Mon, 20 Oct 2025 03:29:54 -0500 Subject: [PATCH 1/5] Fix missing deprecation message for default case statement followed by semicolon (#20172) Follow-up to GH-19215 --- NEWS | 2 ++ Zend/zend_compile.c | 10 +++++----- tests/lang/033.phpt | 2 ++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index ac12a8098b71..08daf17d2199 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,8 @@ PHP NEWS . Fixed bug GH-20113 (Missing new Foo(...) error in constant expressions). (ilutov) . Fixed bug GH-19844 (Don't bail when closing resources on shutdown). (ilutov) + . Fixed deprecation for default case statement followed by semicolon not + being emitted. (theodorejb) - DOM: . Fix getNamedItemNS() incorrect namespace check. (nielsdos) diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 8d6ca5a64346..35228722aa98 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -6333,6 +6333,11 @@ static void zend_compile_switch(zend_ast *ast) /* {{{ */ zend_ast *cond_ast = case_ast->child[0]; znode cond_node; + if (case_ast->attr == ZEND_ALT_CASE_SYNTAX) { + CG(zend_lineno) = case_ast->lineno; + zend_error(E_DEPRECATED, "Case statements followed by a semicolon (;) are deprecated, use a colon (:) instead"); + } + if (!cond_ast) { if (has_default_case) { CG(zend_lineno) = case_ast->lineno; @@ -6343,11 +6348,6 @@ static void zend_compile_switch(zend_ast *ast) /* {{{ */ continue; } - if (case_ast->attr == ZEND_ALT_CASE_SYNTAX) { - CG(zend_lineno) = case_ast->lineno; - zend_error(E_DEPRECATED, "Case statements followed by a semicolon (;) are deprecated, use a colon (:) instead"); - } - zend_compile_expr(&cond_node, cond_ast); if (expr_node.op_type == IS_CONST diff --git a/tests/lang/033.phpt b/tests/lang/033.phpt index 41424e40489d..a8a5837a5501 100644 --- a/tests/lang/033.phpt +++ b/tests/lang/033.phpt @@ -38,6 +38,8 @@ switch ($a): endswitch; ?> --EXPECTF-- +Deprecated: Case statements followed by a semicolon (;) are deprecated, use a colon (:) instead in %s + Deprecated: Case statements followed by a semicolon (;) are deprecated, use a colon (:) instead in %s If: 11 While: 12346789 From 3ac9efe41536dc41a02e7eee9465051c599327a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 20 Oct 2025 10:30:20 +0200 Subject: [PATCH 2/5] uri: Make uri_parser_rfc3986.h usable for external extensions (#20173) This header could not previously be used due to the `uriparser/Uri.h` include, which is required for the struct definition. Since this struct is considered an implementation detail, we can just make it opaque, preserving type safety, but without allowing external users to touch its contents. Fixes php/php-src#19868. --- NEWS | 2 ++ ext/uri/uri_parser_rfc3986.c | 8 ++++++++ ext/uri/uri_parser_rfc3986.h | 7 +------ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/NEWS b/NEWS index 08daf17d2199..908838a60dbf 100644 --- a/NEWS +++ b/NEWS @@ -48,6 +48,8 @@ PHP NEWS - URI: . Fixed bug GH-20088 (Heap-use-after-free in PHP URI WHATWG parser during malformed URL processing). (lexborisov) + . Fixed bug GH-19868 (Unable to use uri_parser_rfc3986.h from external + extensions). (timwolla) 09 Oct 2025, PHP 8.5.0RC2 diff --git a/ext/uri/uri_parser_rfc3986.c b/ext/uri/uri_parser_rfc3986.c index 24dd4e1947b2..628b73b123f6 100644 --- a/ext/uri/uri_parser_rfc3986.c +++ b/ext/uri/uri_parser_rfc3986.c @@ -20,6 +20,14 @@ #include "Zend/zend_smart_str.h" #include "Zend/zend_exceptions.h" +#include + +struct php_uri_parser_rfc3986_uris { + UriUriA uri; + UriUriA normalized_uri; + bool normalized_uri_initialized; +}; + static void *php_uri_parser_rfc3986_memory_manager_malloc(UriMemoryManager *memory_manager, size_t size) { return emalloc(size); diff --git a/ext/uri/uri_parser_rfc3986.h b/ext/uri/uri_parser_rfc3986.h index bdf792816c29..b6d42441db7a 100644 --- a/ext/uri/uri_parser_rfc3986.h +++ b/ext/uri/uri_parser_rfc3986.h @@ -17,16 +17,11 @@ #ifndef PHP_URI_PARSER_RFC3986_H #define PHP_URI_PARSER_RFC3986_H -#include #include "php_uri_common.h" extern const php_uri_parser php_uri_parser_rfc3986; -typedef struct php_uri_parser_rfc3986_uris { - UriUriA uri; - UriUriA normalized_uri; - bool normalized_uri_initialized; -} php_uri_parser_rfc3986_uris; +typedef struct php_uri_parser_rfc3986_uris php_uri_parser_rfc3986_uris; zend_result php_uri_parser_rfc3986_userinfo_read(void *uri, php_uri_component_read_mode read_mode, zval *retval); zend_result php_uri_parser_rfc3986_userinfo_write(void *uri, zval *value, zval *errors); From cea52f796e8339023a452277f7de0cd7e6c2a8eb Mon Sep 17 00:00:00 2001 From: Juliette <663378+jrfnl@users.noreply.github.com> Date: Mon, 20 Oct 2025 10:32:05 +0200 Subject: [PATCH 3/5] PHP 8.5 | UPGRADING: fix entry about new grapheme $locale parameter (#20239) * PHP 8.5 | UPGRADING: fix entry about new grapheme $locale parameter 1. The `grapheme_levenshtein()` function is new to PHP 8.5, so the `$locale` parameter being added does not "change" the function (in the context of changes between PHP 8.4 and 8.5). 2. The `grapheme_substr()` function has also been given the new `$locale` parameter, but was not listed in the changelog entry. Refs: * https://wiki.php.net/rfc/grapheme_levenshtein * https://github.com/php/php-src/commit/bdcea111f30fee395d5830505df5de58598abb5e * https://wiki.php.net/rfc/grapheme_add_locale_for_case_insensitive * https://github.com/php/php-src/commit/ad75c260442d93dc0aeb6857407387d4f871b5d6 * NEWS: Add missing parentheses after `grapheme_substr` Co-authored-by: tekimen --- NEWS | 2 +- UPGRADING | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 908838a60dbf..3f6c29d7a595 100644 --- a/NEWS +++ b/NEWS @@ -217,7 +217,7 @@ PHP NEWS - Intl: . Added grapheme_strpos(), grapheme_stripos(), grapheme_strrpos(), - grapheme_strripos(), grapheme_strstr(), grapheme_stristr() and + grapheme_strripos(), grapheme_substr(), grapheme_strstr(), grapheme_stristr() and grapheme_levenshtein() functions add $locale parameter (Yuya Hamada). . Fixed bug GH-11952 (Fix locale strings canonicalization for IntlDateFormatter and NumberFormatter). (alexandre-daubois) diff --git a/UPGRADING b/UPGRADING index e58d2875832f..b60c9b49d718 100644 --- a/UPGRADING +++ b/UPGRADING @@ -613,8 +613,8 @@ PHP 8.5 UPGRADE NOTES have dropped the false from the return type union. Returning false was actually never possible. . grapheme_strpos(), grapheme_stripos(), grapheme_strrpos(), - grapheme_strripos(), grapheme_strstr(), grapheme_stristr() and - grapheme_levenshtein() functions add $locale parameter. + grapheme_strripos(), grapheme_substr(), grapheme_strstr() + and grapheme_stristr() functions add $locale parameter. RFC: https://wiki.php.net/rfc/grapheme_add_locale_for_case_insensitive - LDAP: From 3273ebef247fef32902284b44ada3082bca8eed5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 20 Oct 2025 12:43:02 +0200 Subject: [PATCH 4/5] .github: Bust the nightly CI cache on Sunday instead of Monday (#20242) The nightly matrix with an empty cache takes several hours to complete due to the amount of jobs. This will effectively block the entire CI for the php organization since there is an organization-wide limit of 20 jobs. Move the cache buster job to Sunday to make it less likely for folks to fight with the Nightly build for resources. --- .github/nightly_matrix.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/nightly_matrix.php b/.github/nightly_matrix.php index 846c60e8fd56..c1f562754268 100644 --- a/.github/nightly_matrix.php +++ b/.github/nightly_matrix.php @@ -49,8 +49,8 @@ function get_current_version(): array { $trigger = $argv[1] ?? 'schedule'; $attempt = (int) ($argv[2] ?? 1); -$monday = date('w', time()) === '1'; -$discard_cache = $monday +$sunday = date('w', time()) === '0'; +$discard_cache = $sunday || ($trigger === 'schedule' && $attempt !== 1) || $trigger === 'workflow_dispatch'; if ($discard_cache) { From 01e339d8b81937685e69156fe17cfda9015ad053 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Mon, 20 Oct 2025 14:52:46 +0200 Subject: [PATCH 5/5] ext/tidy: Enable tidyOptGetCategory on Windows (#20226) The tidy library on Windows has been updated to tidy-html5 5.6.0 which provides tidyOptGetCategory() function and has the TidyInternalCategory enumeration. https://github.com/winlibs/libtidy --- ext/tidy/config.m4 | 3 ++- ext/tidy/config.w32 | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/tidy/config.m4 b/ext/tidy/config.m4 index ef1f5878287d..18fa9acb3d4b 100644 --- a/ext/tidy/config.m4 +++ b/ext/tidy/config.m4 @@ -81,7 +81,8 @@ if test "$PHP_TIDY" != "no"; then ]) AS_VAR_IF([php_ac_cv_have_tidyoptgetcategory], [yes], [AC_DEFINE([HAVE_TIDYOPTGETCATEGORY], [1], - [Define to 1 if tidyOptGetCategory is available.])]) + [Define to 1 if Tidy library has the 'tidyOptGetCategory' function and + supports the 'TidyInternalCategory' enumeration.])]) CPPFLAGS=$old_CPPFLAGS diff --git a/ext/tidy/config.w32 b/ext/tidy/config.w32 index a1f93f2976af..1b2436ac9dfa 100644 --- a/ext/tidy/config.w32 +++ b/ext/tidy/config.w32 @@ -21,6 +21,7 @@ if (PHP_TIDY != "no") { AC_DEFINE('HAVE_TIDY_H', 1, "Define to 1 if you have the header file.") AC_DEFINE('HAVE_TIDYOPTGETDOC', 1, "Define to 1 if Tidy library has the 'tidyOptGetDoc' function.") AC_DEFINE('HAVE_TIDYRELEASEDATE', 1, "Define to 1 if Tidy library has the 'tidyReleaseDate' function.") + AC_DEFINE('HAVE_TIDYOPTGETCATEGORY', 1, "Define to 1 if Tidy library has the 'tidyOptGetCategory' function and supports the 'TidyInternalCategory' enumeration.") ADD_FLAG('CFLAGS_TIDY', '/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1'); if (!PHP_TIDY_SHARED) { ADD_DEF_FILE("ext\\tidy\\php_tidy.def");