From 0f447f4fb9e71d93c5b9f41f840c6e3d36547128 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Fri, 13 Nov 2026 17:00:29 +0000 Subject: [PATCH 1/2] zend_test: add zend_return_non_interned_string() function --- ext/zend_test/test.c | 10 ++++++++++ ext/zend_test/test.stub.php | 2 ++ ext/zend_test/test_arginfo.h | 14 +++++++++----- ext/zend_test/test_decl.h | 8 ++++---- ext/zend_test/test_legacy_arginfo.h | 20 ++++++++++++-------- 5 files changed, 37 insertions(+), 17 deletions(-) diff --git a/ext/zend_test/test.c b/ext/zend_test/test.c index fc346dd5aa0a..2be09665ba21 100644 --- a/ext/zend_test/test.c +++ b/ext/zend_test/test.c @@ -88,6 +88,16 @@ static ZEND_FUNCTION(zend_trigger_bailout) zend_error(E_ERROR, "Bailout"); } +static ZEND_FUNCTION(zend_return_non_interned_string) +{ + zend_string *str; + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &str) == FAILURE) { + RETURN_THROWS(); + } + + RETURN_STRINGL(ZSTR_VAL(str), ZSTR_LEN(str)); +} + static ZEND_FUNCTION(zend_test_array_return) { ZEND_PARSE_PARAMETERS_NONE(); diff --git a/ext/zend_test/test.stub.php b/ext/zend_test/test.stub.php index 87ad8c9b93c8..e93d9a8b1914 100644 --- a/ext/zend_test/test.stub.php +++ b/ext/zend_test/test.stub.php @@ -250,6 +250,8 @@ enum ZendTestEnumWithInterface implements _ZendTestInterface { function zend_trigger_bailout(): never {} + function zend_return_non_interned_string(string $str): string {} + function zend_test_array_return(): array {} /** @genstubs-expose-comment-block diff --git a/ext/zend_test/test_arginfo.h b/ext/zend_test/test_arginfo.h index 314d66a2799a..4967f01cc42a 100644 --- a/ext/zend_test/test_arginfo.h +++ b/ext/zend_test/test_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit test.stub.php instead. - * Stub hash: 64eb27c89a9a5a378385e5f778cd17cfd67caed8 + * Stub hash: b3c6209d96da50e9aa0e0dbd0ee5e9926d64be4d * Has decl header: yes */ #include "zend_attributes.h" @@ -11,6 +11,10 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_trigger_bailout, 0, 0, IS_NEVER, 0) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_return_non_interned_string, 0, 1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_test_array_return, 0, 0, IS_ARRAY, 0) ZEND_END_ARG_INFO() @@ -47,9 +51,7 @@ ZEND_END_ARG_INFO() #define arginfo_zend_test_deprecated_aliased arginfo_zend_test_void_return -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_create_unterminated_string, 0, 1, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) -ZEND_END_ARG_INFO() +#define arginfo_zend_create_unterminated_string arginfo_zend_return_non_interned_string ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_terminate_string, 0, 1, IS_VOID, 0) ZEND_ARG_TYPE_INFO(1, str, IS_STRING, 0) @@ -356,7 +358,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_test_log_err_debug, 0, 1, I ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) ZEND_END_ARG_INFO() -#define arginfo_zend_test_compile_to_ast arginfo_zend_create_unterminated_string +#define arginfo_zend_test_compile_to_ast arginfo_zend_return_non_interned_string #define arginfo_zend_test_gh18756 arginfo_zend_test_void_return @@ -472,6 +474,7 @@ ZEND_END_ARG_INFO() #define arginfo_class_ZendTestNS2_ZendSubNS_Foo_method arginfo_zend_test_void_return static ZEND_FUNCTION(zend_trigger_bailout); +static ZEND_FUNCTION(zend_return_non_interned_string); static ZEND_FUNCTION(zend_test_array_return); static ZEND_FUNCTION(zend_test_nullable_array_return); static ZEND_FUNCTION(zend_test_void_return); @@ -618,6 +621,7 @@ static ZEND_METHOD(ZendTestNS2_ZendSubNS_Foo, method); static const zend_function_entry ext_functions[] = { ZEND_FE(zend_trigger_bailout, arginfo_zend_trigger_bailout) + ZEND_FE(zend_return_non_interned_string, arginfo_zend_return_non_interned_string) ZEND_FE(zend_test_array_return, arginfo_zend_test_array_return) #if (PHP_VERSION_ID >= 80400) ZEND_RAW_FENTRY("zend_test_nullable_array_return", zif_zend_test_nullable_array_return, arginfo_zend_test_nullable_array_return, ZEND_ACC_COMPILE_TIME_EVAL, NULL, "/**\n * \"Lorem ipsum\"\n * @see https://www.php.net\n * @since 8.3\n */") diff --git a/ext/zend_test/test_decl.h b/ext/zend_test/test_decl.h index 494e097fa576..9c2591f61baa 100644 --- a/ext/zend_test/test_decl.h +++ b/ext/zend_test/test_decl.h @@ -1,8 +1,8 @@ /* This is a generated file, edit test.stub.php instead. - * Stub hash: 64eb27c89a9a5a378385e5f778cd17cfd67caed8 */ + * Stub hash: b3c6209d96da50e9aa0e0dbd0ee5e9926d64be4d */ -#ifndef ZEND_TEST_DECL_64eb27c89a9a5a378385e5f778cd17cfd67caed8_H -#define ZEND_TEST_DECL_64eb27c89a9a5a378385e5f778cd17cfd67caed8_H +#ifndef ZEND_TEST_DECL_b3c6209d96da50e9aa0e0dbd0ee5e9926d64be4d_H +#define ZEND_TEST_DECL_b3c6209d96da50e9aa0e0dbd0ee5e9926d64be4d_H typedef enum zend_enum_ZendTestUnitEnum { ZEND_ENUM_ZendTestUnitEnum_Foo = 1, @@ -27,4 +27,4 @@ typedef enum zend_enum_ZendTestEnumWithInterface { ZEND_ENUM_ZendTestEnumWithInterface_Bar = 2, } zend_enum_ZendTestEnumWithInterface; -#endif /* ZEND_TEST_DECL_64eb27c89a9a5a378385e5f778cd17cfd67caed8_H */ +#endif /* ZEND_TEST_DECL_b3c6209d96da50e9aa0e0dbd0ee5e9926d64be4d_H */ diff --git a/ext/zend_test/test_legacy_arginfo.h b/ext/zend_test/test_legacy_arginfo.h index f941cf44c573..9faa1c2bf18b 100644 --- a/ext/zend_test/test_legacy_arginfo.h +++ b/ext/zend_test/test_legacy_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit test.stub.php instead. - * Stub hash: 64eb27c89a9a5a378385e5f778cd17cfd67caed8 + * Stub hash: b3c6209d96da50e9aa0e0dbd0ee5e9926d64be4d * Has decl header: yes */ #include "zend_constants.h" @@ -10,6 +10,10 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_zend_trigger_bailout, 0, 0, 0) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_zend_return_non_interned_string, 0, 0, 1) + ZEND_ARG_INFO(0, str) +ZEND_END_ARG_INFO() + #define arginfo_zend_test_array_return arginfo_zend_trigger_bailout #define arginfo_zend_test_nullable_array_return arginfo_zend_trigger_bailout @@ -42,9 +46,7 @@ ZEND_END_ARG_INFO() #define arginfo_zend_test_deprecated_aliased arginfo_zend_trigger_bailout -ZEND_BEGIN_ARG_INFO_EX(arginfo_zend_create_unterminated_string, 0, 0, 1) - ZEND_ARG_INFO(0, str) -ZEND_END_ARG_INFO() +#define arginfo_zend_create_unterminated_string arginfo_zend_return_non_interned_string ZEND_BEGIN_ARG_INFO_EX(arginfo_zend_terminate_string, 0, 0, 1) ZEND_ARG_INFO(1, str) @@ -233,9 +235,9 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_zend_test_refcount, 0, 0, 1) ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() -#define arginfo_zend_test_zend_ini_parse_quantity arginfo_zend_create_unterminated_string +#define arginfo_zend_test_zend_ini_parse_quantity arginfo_zend_return_non_interned_string -#define arginfo_zend_test_zend_ini_parse_uquantity arginfo_zend_create_unterminated_string +#define arginfo_zend_test_zend_ini_parse_uquantity arginfo_zend_return_non_interned_string #define arginfo_zend_test_zend_ini_str arginfo_zend_trigger_bailout @@ -291,9 +293,9 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_zend_test_is_zend_ptr, 0, 0, 1) ZEND_ARG_INFO(0, addr) ZEND_END_ARG_INFO() -#define arginfo_zend_test_log_err_debug arginfo_zend_create_unterminated_string +#define arginfo_zend_test_log_err_debug arginfo_zend_return_non_interned_string -#define arginfo_zend_test_compile_to_ast arginfo_zend_create_unterminated_string +#define arginfo_zend_test_compile_to_ast arginfo_zend_return_non_interned_string #define arginfo_zend_test_gh18756 arginfo_zend_trigger_bailout @@ -396,6 +398,7 @@ ZEND_END_ARG_INFO() #define arginfo_class_ZendTestNS2_ZendSubNS_Foo_method arginfo_zend_trigger_bailout static ZEND_FUNCTION(zend_trigger_bailout); +static ZEND_FUNCTION(zend_return_non_interned_string); static ZEND_FUNCTION(zend_test_array_return); static ZEND_FUNCTION(zend_test_nullable_array_return); static ZEND_FUNCTION(zend_test_void_return); @@ -542,6 +545,7 @@ static ZEND_METHOD(ZendTestNS2_ZendSubNS_Foo, method); static const zend_function_entry ext_functions[] = { ZEND_FE(zend_trigger_bailout, arginfo_zend_trigger_bailout) + ZEND_FE(zend_return_non_interned_string, arginfo_zend_return_non_interned_string) ZEND_FE(zend_test_array_return, arginfo_zend_test_array_return) ZEND_FE(zend_test_nullable_array_return, arginfo_zend_test_nullable_array_return) ZEND_FE(zend_test_void_return, arginfo_zend_test_void_return) From de531ac9c5f3c1ad30dda897371a6c6046e5465d Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Fri, 13 Nov 2026 17:04:48 +0000 Subject: [PATCH 2/2] tree: use new zend_return_non_interned_string() to prevent SCCP interning --- .../value_unknown_at_compile_time_001.phpt | 6 ++++-- .../value_unknown_at_compile_time_001.phpt | 6 ++++-- .../tests/attributes/deprecated/message_004.phpt | 6 ++++-- Zend/tests/error_reporting/bug81652.phpt | 2 ++ .../tests/refcounted_return_must_not_leak.phpt | 3 ++- ext/dom/tests/DOMXPath_callables_errors.phpt | 3 ++- ext/dom/tests/gh12002.phpt | 12 ++++-------- .../modern/html/parser/Element_innerHTML.phpt | 3 ++- ext/intl/tests/msgfmt_format_error4.phpt | 3 ++- .../ldap_set_option_leak_attrvalue_context.phpt | 5 +++-- ext/pcre/tests/preg_match_frameless_leak.phpt | 5 ++++- .../pdo_fetch_class_by_ref_constructor.phpt | 16 ++++++++-------- ext/pdo_firebird/tests/gh18276.phpt | 7 ++++--- ext/phar/tests/gh18953.phpt | 3 ++- ...enssl_sign_invalid_polyfill_return_value.phpt | 3 ++- .../user_session_module/gh_gc_retval_leak.phpt | 3 ++- ext/snmp/tests/gh16959.phpt | 7 ++++--- .../snmp-object-setSecurity-contextName.phpt | 3 ++- ext/standard/tests/array/gh17977.phpt | 6 +++--- 19 files changed, 60 insertions(+), 42 deletions(-) diff --git a/Zend/tests/attributes/deprecated/class_constants/value_unknown_at_compile_time_001.phpt b/Zend/tests/attributes/deprecated/class_constants/value_unknown_at_compile_time_001.phpt index 78367ffc0650..176dc6241fba 100644 --- a/Zend/tests/attributes/deprecated/class_constants/value_unknown_at_compile_time_001.phpt +++ b/Zend/tests/attributes/deprecated/class_constants/value_unknown_at_compile_time_001.phpt @@ -1,9 +1,11 @@ --TEST-- #[\Deprecated]: Class constant with value unknown at compile time. +--EXTENSIONS-- +zend_test --FILE-- --EXPECTF-- Deprecated: Constant Clazz::CONSTANT is deprecated in %s on line %d -string(7) "Clazz-%c" +string(7) "Clazz-a" bool(true) diff --git a/Zend/tests/attributes/deprecated/constants/value_unknown_at_compile_time_001.phpt b/Zend/tests/attributes/deprecated/constants/value_unknown_at_compile_time_001.phpt index a968e26673e3..645a1a902f70 100644 --- a/Zend/tests/attributes/deprecated/constants/value_unknown_at_compile_time_001.phpt +++ b/Zend/tests/attributes/deprecated/constants/value_unknown_at_compile_time_001.phpt @@ -1,9 +1,11 @@ --TEST-- #[\Deprecated]: Constant with value unknown at compile time. +--EXTENSIONS-- +zend_test --FILE-- --EXPECTF-- Deprecated: Constant CONSTANT is deprecated in %s on line %d -string(8) "Prefix-%c" +string(8) "Prefix-a" bool(true) diff --git a/Zend/tests/attributes/deprecated/message_004.phpt b/Zend/tests/attributes/deprecated/message_004.phpt index 74860ba82b7f..e766810704f7 100644 --- a/Zend/tests/attributes/deprecated/message_004.phpt +++ b/Zend/tests/attributes/deprecated/message_004.phpt @@ -1,9 +1,11 @@ --TEST-- #[\Deprecated]: Message with value unknown at compile time. +--EXTENSIONS-- +zend_test --FILE-- --EXPECTF-- -Deprecated: Function test() is deprecated, value-%c in %s on line %d +Deprecated: Function test() is deprecated, value-a in %s on line %d diff --git a/Zend/tests/error_reporting/bug81652.phpt b/Zend/tests/error_reporting/bug81652.phpt index a115f590add0..c5382ec89b5e 100644 --- a/Zend/tests/error_reporting/bug81652.phpt +++ b/Zend/tests/error_reporting/bug81652.phpt @@ -1,5 +1,7 @@ --TEST-- Bug #81652: The value of error_reporting() gets overridden +--EXTENSIONS-- +zend_test --FILE-- registerPhpFunctions([$str]); } catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; diff --git a/ext/dom/tests/gh12002.phpt b/ext/dom/tests/gh12002.phpt index 2512aa7d23fb..9d89e0b7b8de 100644 --- a/ext/dom/tests/gh12002.phpt +++ b/ext/dom/tests/gh12002.phpt @@ -2,24 +2,20 @@ GH-12002 (DOMDocument::encoding memory leak with invalid encoding) --EXTENSIONS-- dom +zend_test --FILE-- encoding = make_nonconst('utf-8'); +$dom->encoding = zend_return_non_interned_string('utf-8'); var_dump($dom->encoding); try { - $dom->encoding = make_nonconst('foobar'); + $dom->encoding = zend_return_non_interned_string('foobar'); } catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($dom->encoding); -$dom->encoding = make_nonconst('utf-16le'); +$dom->encoding = zend_return_non_interned_string('utf-16le'); var_dump($dom->encoding); try { $dom->encoding = NULL; diff --git a/ext/dom/tests/modern/html/parser/Element_innerHTML.phpt b/ext/dom/tests/modern/html/parser/Element_innerHTML.phpt index 7e76cad0a128..fecb26f6a495 100644 --- a/ext/dom/tests/modern/html/parser/Element_innerHTML.phpt +++ b/ext/dom/tests/modern/html/parser/Element_innerHTML.phpt @@ -2,6 +2,7 @@ Test writing Element::$innerHTML on HTML documents --EXTENSIONS-- dom +zend_test --FILE-- innerHTML = "invalid\xffutf-8𐍈𐍈𐍈"; echo $dom->saveXML(), "\n"; // Create a non-interned string that gets the UTF-8 validity flag added -$str = str_repeat("my valid string", random_int(2, 2)); +$str = zend_return_non_interned_string("my valid string"); preg_match('/^.*$/u', $str); $el->innerHTML = $str; echo $dom->saveXML(), "\n"; diff --git a/ext/intl/tests/msgfmt_format_error4.phpt b/ext/intl/tests/msgfmt_format_error4.phpt index 78dc27b4092e..f92dab244b79 100644 --- a/ext/intl/tests/msgfmt_format_error4.phpt +++ b/ext/intl/tests/msgfmt_format_error4.phpt @@ -2,6 +2,7 @@ MessageFormatter::format() invalid UTF-8 for arg key or value --EXTENSIONS-- intl +zend_test --INI-- intl.use_exceptions=On --FILE-- @@ -29,7 +30,7 @@ try { try { var_dump($mf->format(array("foo" => new class { function __toString(): string { - return str_repeat("\x80", random_int(1, 1)); + return zend_return_non_interned_string("\x80"); } }))); } catch (Throwable $e) { diff --git a/ext/ldap/tests/ldap_set_option_leak_attrvalue_context.phpt b/ext/ldap/tests/ldap_set_option_leak_attrvalue_context.phpt index 5829ad24faf5..acced946ecc4 100644 --- a/ext/ldap/tests/ldap_set_option_leak_attrvalue_context.phpt +++ b/ext/ldap/tests/ldap_set_option_leak_attrvalue_context.phpt @@ -2,14 +2,15 @@ ldap_set_option() - Leaks attrvalue and context --EXTENSIONS-- ldap +zend_test --FILE-- "2.16.840.1.113730.3.4.9", "value" => ["attrvalue" => $attrvalue, "context" => $context, "before" => 0, "after" => 0]], diff --git a/ext/pcre/tests/preg_match_frameless_leak.phpt b/ext/pcre/tests/preg_match_frameless_leak.phpt index b97cb86347fb..16958033a25a 100644 --- a/ext/pcre/tests/preg_match_frameless_leak.phpt +++ b/ext/pcre/tests/preg_match_frameless_leak.phpt @@ -1,11 +1,14 @@ --TEST-- Memory leak in preg_match() frameless function with invalid regex and object arguments +--EXTENSIONS-- +pcre +zend_test --FILE-- val = str_repeat($val, random_int(1, 1)); + $this->val = zend_return_non_interned_string($val); } public function __toString() { return $this->val; diff --git a/ext/pdo/tests/pdo_fetch_class_by_ref_constructor.phpt b/ext/pdo/tests/pdo_fetch_class_by_ref_constructor.phpt index 4524980b2c4a..db7dedab008b 100644 --- a/ext/pdo/tests/pdo_fetch_class_by_ref_constructor.phpt +++ b/ext/pdo/tests/pdo_fetch_class_by_ref_constructor.phpt @@ -2,6 +2,7 @@ PDO Common: PDO::FETCH_CLASS with by-ref constructor and arg by value --EXTENSIONS-- pdo +zend_test --SKIPIF-- execute(); -// Use of random_int(10,10) is to defeat SCCP -var_dump($stmt->fetchAll(PDO::FETCH_CLASS, 'TestByRefCtor', [str_repeat('a', random_int(10,10))])); +var_dump($stmt->fetchAll(PDO::FETCH_CLASS, 'TestByRefCtor', [zend_return_non_interned_string('a')])); ?> --CLEAN-- @@ -48,13 +48,13 @@ PDOTest::dropTableIfExists($db, "pdo_fetch_class_by_ref_ctor"); ?> --EXPECTF-- Warning: TestByRefCtor::__construct(): Argument #1 ($str) must be passed by reference, value given in %s on line %d -TestByRefCtor::__construct(aaaaaaaaaa, 1) +TestByRefCtor::__construct(a, 1) Warning: TestByRefCtor::__construct(): Argument #1 ($str) must be passed by reference, value given in %s on line %d -TestByRefCtor::__construct(aaaaaaaaaa, 2) +TestByRefCtor::__construct(a, 2) Warning: TestByRefCtor::__construct(): Argument #1 ($str) must be passed by reference, value given in %s on line %d -TestByRefCtor::__construct(aaaaaaaaaa, 3) +TestByRefCtor::__construct(a, 3) array(3) { [0]=> object(TestByRefCtor)#%d (3) { @@ -63,7 +63,7 @@ array(3) { ["val"]=> string(1) "A" ["str":"TestByRefCtor":private]=> - string(11) "aaaaaaaaaaA" + string(2) "aA" } [1]=> object(TestByRefCtor)#%d (3) { @@ -72,7 +72,7 @@ array(3) { ["val"]=> string(1) "B" ["str":"TestByRefCtor":private]=> - string(11) "aaaaaaaaaaB" + string(2) "aB" } [2]=> object(TestByRefCtor)#%d (3) { @@ -81,6 +81,6 @@ array(3) { ["val"]=> string(1) "C" ["str":"TestByRefCtor":private]=> - string(11) "aaaaaaaaaaC" + string(2) "aC" } } diff --git a/ext/pdo_firebird/tests/gh18276.phpt b/ext/pdo_firebird/tests/gh18276.phpt index 5a1c4b4de295..09c56c2fd4f9 100644 --- a/ext/pdo_firebird/tests/gh18276.phpt +++ b/ext/pdo_firebird/tests/gh18276.phpt @@ -2,6 +2,7 @@ GH-18276 (persistent connection - setAttribute(Pdo\Firebird::ATTR_DATE_FORMAT, ..) results in "zend_mm_heap corrupted") --EXTENSIONS-- pdo_firebird +zend_test --SKIPIF-- --XLEAK-- @@ -23,9 +24,9 @@ for ($i = 0; $i < 2; $i++) { ], ); // Avoid interned - $dbh->setAttribute(Pdo\Firebird::ATTR_DATE_FORMAT, str_repeat('Y----m----d', random_int(1, 1))); - $dbh->setAttribute(Pdo\Firebird::ATTR_TIME_FORMAT, str_repeat('H::::i::::s', random_int(1, 1))); - $dbh->setAttribute(Pdo\Firebird::ATTR_TIMESTAMP_FORMAT, str_repeat('Y----m----d....H::::i::::s', random_int(1, 1))); + $dbh->setAttribute(Pdo\Firebird::ATTR_DATE_FORMAT, zend_return_non_interned_string('Y----m----d')); + $dbh->setAttribute(Pdo\Firebird::ATTR_TIME_FORMAT, zend_return_non_interned_string('H::::i::::s')); + $dbh->setAttribute(Pdo\Firebird::ATTR_TIMESTAMP_FORMAT, zend_return_non_interned_string('Y----m----d....H::::i::::s')); unset($dbh); } diff --git a/ext/phar/tests/gh18953.phpt b/ext/phar/tests/gh18953.phpt index ff48e457cc9f..bef854b89c81 100644 --- a/ext/phar/tests/gh18953.phpt +++ b/ext/phar/tests/gh18953.phpt @@ -3,13 +3,14 @@ GH-18953 (Phar: Stream double free) --EXTENSIONS-- phar zlib +zend_test --INI-- phar.readonly=0 --FILE-- addFromString("file", str_repeat("123", random_int(1, 1))); +$phar->addFromString("file", zend_return_non_interned_string("123")); $phar->addEmptyDir("dir"); $phar2 = $phar->compress(Phar::GZ); diff --git a/ext/phar/tests/openssl_sign_invalid_polyfill_return_value.phpt b/ext/phar/tests/openssl_sign_invalid_polyfill_return_value.phpt index 37c14188edf9..7dbde3e909f4 100644 --- a/ext/phar/tests/openssl_sign_invalid_polyfill_return_value.phpt +++ b/ext/phar/tests/openssl_sign_invalid_polyfill_return_value.phpt @@ -2,6 +2,7 @@ openssl_sign() polyfill with wrong return value --EXTENSIONS-- phar +zend_test --SKIPIF-- getMessage() . PHP_EOL; } try { - snmp2_set($hostname, $communityWrite, $bad_object_ids, array("toolongtype"), array(null)); + snmp2_set($hostname, $communityWrite, $bad_object_ids, ["toolongtype"], [null]); } catch (Throwable $e) { echo $e->getMessage() . PHP_EOL; } try { - snmp2_set($hostname, $communityWrite, $bad_object_ids, array(str_repeat("onetoomuch", random_int(1, 1))), array(null)); + snmp2_set($hostname, $communityWrite, $bad_object_ids, [zend_return_non_interned_string("onetoomuch")], [null]); } catch (Throwable $e) { echo $e->getMessage(); } diff --git a/ext/snmp/tests/snmp-object-setSecurity-contextName.phpt b/ext/snmp/tests/snmp-object-setSecurity-contextName.phpt index 95055e2be8f3..256ebd1d6345 100644 --- a/ext/snmp/tests/snmp-object-setSecurity-contextName.phpt +++ b/ext/snmp/tests/snmp-object-setSecurity-contextName.phpt @@ -2,6 +2,7 @@ SNMP::setSecurity() - the context name is copied --EXTENSIONS-- snmp +zend_test --SKIPIF-- setSecurity('authPriv', 'MD5', $auth_pass, 'AES', $priv_pass, $context); unset($context); // The agent does not know this context, only the lifetime of the name matters. diff --git a/ext/standard/tests/array/gh17977.phpt b/ext/standard/tests/array/gh17977.phpt index 4a4f344dc475..b85952a32138 100644 --- a/ext/standard/tests/array/gh17977.phpt +++ b/ext/standard/tests/array/gh17977.phpt @@ -2,12 +2,12 @@ array_any() / array_all() leak --DESCRIPTION-- Found in GH-16831#issuecomment-2700410631 +--EXTENSIONS-- +zend_test --FILE-- 1], static fn () => true)); var_dump(array_all([$key => 1], static fn () => false));