Commit b4fb1d71704 for php
commit b4fb1d71704441c90705069088ddf1760912529a
Author: Jorg Sowa <jorg.sowa@gmail.com>
Date: Thu Nov 5 00:20:51 2026 +0100
Fix AST printing of interface extends list as implements
Closes GH-25064
diff --git a/NEWS b/NEWS
index 578709a0a5d..0e2a521673f 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,9 @@ PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? ????, PHP 8.4.29
+- Core:
+ . Fixed AST printing of interface extends list as implements. (Jorg Sowa)
+
- Curl:
. Fixed curl_reset() retaining CURLOPT_PRIVATE after reset. (lacatoire)
diff --git a/Zend/tests/assert/expect_interface_extends.phpt b/Zend/tests/assert/expect_interface_extends.phpt
new file mode 100644
index 00000000000..61775ffb9c2
--- /dev/null
+++ b/Zend/tests/assert/expect_interface_extends.phpt
@@ -0,0 +1,22 @@
+--TEST--
+AST printing of interface extends list
+--INI--
+zend.assertions=1
+--FILE--
+<?php
+
+try {
+ assert(false && function () {
+ interface I extends A, B {}
+ });
+} catch (AssertionError $e) {
+ echo $e->getMessage(), "\n";
+}
+
+?>
+--EXPECT--
+assert(false && function () {
+ interface I extends A, B {
+ }
+
+})
diff --git a/Zend/zend_ast.c b/Zend/zend_ast.c
index e0606dbb041..eec705588a1 100644
--- a/Zend/zend_ast.c
+++ b/Zend/zend_ast.c
@@ -1669,7 +1669,7 @@ static ZEND_COLD void zend_ast_export_class_no_header(smart_str *str, zend_ast_d
zend_ast_export_ns_name(str, decl->child[0], 0, indent);
}
if (decl->child[1]) {
- smart_str_appends(str, " implements ");
+ smart_str_appends(str, (decl->flags & ZEND_ACC_INTERFACE) ? " extends " : " implements ");
zend_ast_export_ex(str, decl->child[1], 0, indent);
}
smart_str_appends(str, " {\n");