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

From: Date: Sat, 31 Oct 2026 15:20:15 +0000
Subject: [php-src] master: Merge branch 'PHP-8.6'
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-143074@lists.php.net to get a copy of this message
Author: Jorg Sowa (jorgsowa) Date: 2026-10-31T16:17:45+01:00 Commit: https://github.com/php/php-src/commit/4df9574ab4d773118e28b9daaa09a1f45be3407c Raw diff: https://github.com/php/php-src/commit/4df9574ab4d773118e28b9daaa09a1f45be3407c.diff Merge branch 'PHP-8.6' # Conflicts: # NEWS Changed paths: A Zend/tests/assert/expect_readonly_anon_class.phpt M Zend/zend_ast.c Diff: diff --git a/Zend/tests/assert/expect_readonly_anon_class.phpt b/Zend/tests/assert/expect_readonly_anon_class.phpt new file mode 100644 index 000000000000..5944475ffc4e --- /dev/null +++ b/Zend/tests/assert/expect_readonly_anon_class.phpt @@ -0,0 +1,22 @@ +--TEST-- +AST export of readonly anonymous class +--INI-- +zend.assertions=1 +--FILE-- +<?php +try { + assert(false && new readonly class {}); +} catch (AssertionError $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; +} +try { + assert(false && new #[A] readonly class(1) {}); +} catch (AssertionError $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; +} +?> +--EXPECT-- +AssertionError: assert(false && new readonly class { +}) +AssertionError: assert(false && new #[A] readonly class(1) { +}) diff --git a/Zend/zend_ast.c b/Zend/zend_ast.c index 76ba83395ccd..cae351fe3157 100644 --- a/Zend/zend_ast.c +++ b/Zend/zend_ast.c @@ -2804,6 +2804,9 @@ static ZEND_COLD void zend_ast_export_ex(smart_str *str, zend_ast *ast, int prio if (decl->child[3]) { zend_ast_export_attributes(str, decl->child[3], indent, false); } + if (decl->flags & ZEND_ACC_READONLY_CLASS) { + smart_str_appends(str, "readonly "); + } smart_str_appends(str, "class"); if (!zend_ast_is_list(ast->child[1]) || zend_ast_get_list(ast->child[1])->children) {

« previous php.cvs (#143074) next »