From bdf62b55bb9ba0847c9c10708ce06357723c5546 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Wed, 5 Nov 2025 09:34:14 -0500 Subject: [PATCH 1/2] ext/pcre/tests: support libpcre2-10.47 In the latest version of libpcre2, the offsets appearing in some "compilation failed" warnings have increased by one, as a result of https://github.com/PCRE2Project/pcre2/pull/756 This is causing spurious test failures, so in this commit we replace the hard-coded offsets by a regex that matches both values. Gentoo-bug: https://bugs.gentoo.org/965018 Closes GH-20397 --- ext/pcre/tests/grep2.phpt | 2 +- ext/pcre/tests/pcre_extra.phpt | 4 ++-- ext/pcre/tests/split.phpt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ext/pcre/tests/grep2.phpt b/ext/pcre/tests/grep2.phpt index 9721dfbd9eec1..a953b13c49d54 100644 --- a/ext/pcre/tests/grep2.phpt +++ b/ext/pcre/tests/grep2.phpt @@ -21,7 +21,7 @@ var_dump(preg_last_error() == PREG_RECURSION_LIMIT_ERROR); ?> --EXPECTF-- -Warning: preg_grep(): Compilation failed: quantifier does not follow a repeatable item at offset 0 in %sgrep2.php on line %d +Warning: preg_grep(): Compilation failed: quantifier does not follow a repeatable item at offset %r(0|1)%r in %sgrep2.php on line %d bool(false) array(3) { [5]=> diff --git a/ext/pcre/tests/pcre_extra.phpt b/ext/pcre/tests/pcre_extra.phpt index 730c7299390cb..660e0a1488a1d 100644 --- a/ext/pcre/tests/pcre_extra.phpt +++ b/ext/pcre/tests/pcre_extra.phpt @@ -8,8 +8,8 @@ var_dump(preg_match('/\y/X', '\y')); ?> --EXPECTF-- -Warning: preg_match(): Compilation failed: unrecognized character follows \ at offset 1 in %spcre_extra.php on line 3 +Warning: preg_match(): Compilation failed: unrecognized character follows \ at offset %r(1|2)%r in %spcre_extra.php on line 3 bool(false) -Warning: preg_match(): Compilation failed: unrecognized character follows \ at offset 1 in %spcre_extra.php on line 4 +Warning: preg_match(): Compilation failed: unrecognized character follows \ at offset %r(1|2)%r in %spcre_extra.php on line 4 bool(false) diff --git a/ext/pcre/tests/split.phpt b/ext/pcre/tests/split.phpt index df4b9af92f2f9..27f1c85b433ea 100644 --- a/ext/pcre/tests/split.phpt +++ b/ext/pcre/tests/split.phpt @@ -16,7 +16,7 @@ var_dump(preg_split('/\d*/', 'ab2c3u', -1, PREG_SPLIT_NO_EMPTY)); ?> --EXPECTF-- -Warning: preg_split(): Compilation failed: quantifier does not follow a repeatable item at offset 0 in %ssplit.php on line %d +Warning: preg_split(): Compilation failed: quantifier does not follow a repeatable item at offset %r(0|1)%r in %ssplit.php on line %d bool(false) array(3) { [0]=> From 55d449fca4c63dc877d599df35ef35fae456aa03 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Fri, 7 Nov 2025 20:01:04 +0000 Subject: [PATCH 2/2] Zend: remove zend_set_hash_symbol() API (#20413) This is unused both within php-src and a SourceGraph search returned 0 results. This is also confusing as it talks about symbol tables without actually using any of the corresponding update functions. --- UPGRADING.INTERNALS | 1 + Zend/zend_API.c | 23 ----------------------- Zend/zend_API.h | 2 -- 3 files changed, 1 insertion(+), 25 deletions(-) diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 385ad0445cc99..57cae9aa04724 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -43,6 +43,7 @@ PHP 8.6 INTERNALS UPGRADE NOTES pointer. . The zend_get_call_trampoline_func() API now takes the __call or __callStatic zend_function* instead of a CE and a boolean argument. + . The zend_set_hash_symbol() API has been removed. ======================== 2. Build system changes diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 89ffe419cd6e4..097a27452196e 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -3611,29 +3611,6 @@ ZEND_API zend_result zend_register_class_alias_ex(const char *name, size_t name_ } /* }}} */ -// TODO num_symbol_tables as unsigned int? -ZEND_API zend_result zend_set_hash_symbol(zval *symbol, const char *name, size_t name_length, bool is_ref, int num_symbol_tables, ...) /* {{{ */ -{ - HashTable *symbol_table; - va_list symbol_table_list; - - if (num_symbol_tables <= 0) return FAILURE; - - if (is_ref) { - ZVAL_MAKE_REF(symbol); - } - - va_start(symbol_table_list, num_symbol_tables); - while (num_symbol_tables-- > 0) { - symbol_table = va_arg(symbol_table_list, HashTable *); - zend_hash_str_update(symbol_table, name, name_length, symbol); - Z_TRY_ADDREF_P(symbol); - } - va_end(symbol_table_list); - return SUCCESS; -} -/* }}} */ - /* Disabled functions support */ static void zend_disable_function(const char *function_name, size_t function_name_length) diff --git a/Zend/zend_API.h b/Zend/zend_API.h index d8ad9edabf5bb..eba5ef8c8a08e 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -884,8 +884,6 @@ ZEND_API zend_result zend_call_method_if_exists( zend_object *object, zend_string *method_name, zval *retval, uint32_t param_count, zval *params); -ZEND_API zend_result zend_set_hash_symbol(zval *symbol, const char *name, size_t name_length, bool is_ref, int num_symbol_tables, ...); - ZEND_API zend_result zend_delete_global_variable(zend_string *name); ZEND_API zend_array *zend_rebuild_symbol_table(void);