Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ PHP NEWS
(Marti2203).
. Fixed bug GH-24989 (Use-after-free in GC when an exception is thrown).
(David Carlier)
. Fixed AST printing dropping fully qualified and namespace-relative prefixes
of class names in implements, catch, and trait use lists. (Jorg Sowa)

- CLI:
. Fixed bug GH-24697 (PHP_HTTP_PARSER_STRICT build option doesn't work).
Expand Down
37 changes: 37 additions & 0 deletions Zend/tests/assert/expect_qualified_name_lists.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
--TEST--
AST printing of fully qualified and namespace-relative names in name lists
--INI--
zend.assertions=1
--FILE--
<?php

try {
assert(false && function () {
class C implements \A, namespace\B, C {
use \T1, namespace\T2, T3 {
\T1::foo insteadof namespace\T2, T3;
namespace\T2::foo as bar;
}
}
try {
} catch (\E1 | namespace\E2 | E3 $e) {
}
});
} catch (AssertionError $e) {
echo $e->getMessage(), "\n";
}

?>
--EXPECT--
assert(false && function () {
class C implements \A, namespace\B, C {
use \T1, namespace\T2, T3 {
\T1::foo insteadof namespace\T2, T3;
namespace\T2::foo as bar;
}
}

try {
} catch (\E1|namespace\E2|E3 $e) {
}
})
4 changes: 2 additions & 2 deletions Zend/zend_ast.c
Original file line number Diff line number Diff line change
Expand Up @@ -1496,7 +1496,7 @@ static ZEND_COLD void zend_ast_export_name_list_ex(smart_str *str, zend_ast_list
if (i != 0) {
smart_str_appends(str, separator);
}
zend_ast_export_name(str, list->child[i], 0, indent);
zend_ast_export_ns_name(str, list->child[i], 0, indent);
i++;
}
}
Expand Down Expand Up @@ -2468,7 +2468,7 @@ static ZEND_COLD void zend_ast_export_ex(smart_str *str, zend_ast *ast, int prio
break;
case ZEND_AST_METHOD_REFERENCE:
if (ast->child[0]) {
zend_ast_export_name(str, ast->child[0], 0, indent);
zend_ast_export_ns_name(str, ast->child[0], 0, indent);
smart_str_appends(str, "::");
}
zend_ast_export_name(str, ast->child[1], 0, indent);
Expand Down
Loading