[php-src] master: Merge branch 'PHP-8.6'

From: Date: Sat, 26 Sep 2026 19:09:47 +0000
Subject: [php-src] master: Merge branch 'PHP-8.6'
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-141590@lists.php.net to get a copy of this message
Author: David Carlier (devnexen) Date: 2026-09-26T20:08:54+01:00 Commit: https://github.com/php/php-src/commit/646f1a070d5662a45a85d1fe33a277bcfea046e2 Raw diff: https://github.com/php/php-src/commit/646f1a070d5662a45a85d1fe33a277bcfea046e2.diff Merge branch 'PHP-8.6' * PHP-8.6: ext/intl: intl_error_set_custom_msg() crash without an active call frame Changed paths: A ext/intl/tests/uconverter_shutdown_subclass.phpt M ext/intl/intl_error.c Diff: diff --git a/ext/intl/intl_error.c b/ext/intl/intl_error.c index eab1b7478155..cfc16ff2ecba 100644 --- a/ext/intl/intl_error.c +++ b/ext/intl/intl_error.c @@ -91,13 +91,18 @@ void intl_error_set_custom_msg( intl_error* err, const char* msg) return; } - zend_string *method_or_func = get_active_function_or_method_name(); - zend_string *prefixed_message = zend_string_concat3( - ZSTR_VAL(method_or_func), ZSTR_LEN(method_or_func), - ZEND_STRL("(): "), - msg, strlen(msg) - ); - zend_string_release_ex(method_or_func, false); + zend_string *prefixed_message; + if (zend_is_executing()) { + zend_string *method_or_func = get_active_function_or_method_name(); + prefixed_message = zend_string_concat3( + ZSTR_VAL(method_or_func), ZSTR_LEN(method_or_func), + ZEND_STRL("(): "), + msg, strlen(msg) + ); + zend_string_release_ex(method_or_func, false); + } else { + prefixed_message = zend_string_init(msg, strlen(msg), false); + } if( !err ) { if (INTL_G(error_level)) { diff --git a/ext/intl/tests/uconverter_shutdown_subclass.phpt b/ext/intl/tests/uconverter_shutdown_subclass.phpt new file mode 100644 index 000000000000..09c231a99e9c --- /dev/null +++ b/ext/intl/tests/uconverter_shutdown_subclass.phpt @@ -0,0 +1,21 @@ +--TEST-- +UConverter subclass destroyed at request shutdown does not crash +--EXTENSIONS-- +intl +--FILE-- +<?php +class MyConverter extends UConverter { + public function toUCallback($reason, $source, $codeUnits, &$error): string|int|array|null { + return '?'; + } + + public function fromUCallback($reason, $source, $codePoint, &$error): string|int|array|null { + return '?'; + } +} + +$converter = new MyConverter('ascii', 'utf-8'); +echo 'end of script', PHP_EOL; +?> +--EXPECT-- +end of script

« previous php.cvs (#141590) next »