Skip to content

A group use with function and const items fails to parse ("expected '}' to close use group") #478

Closed

Description

@blacktrs

Summary

A group use with function and const items fails to parse ("expected '}' to close use group").

Repro

<?php
namespace A {
    function e() { return 'e'; }
    const K = 'k';
}
namespace {
    use A\{function e, const K};
    echo e(), K, "\n";
}

Expected (php)

ek

Actual (manticore 9f2c1322, Darwin arm64)

compile failed (rc=65):
tests/aot/repro/wrong/use_group_function_const.php:8:21: error: expected '}' to close use group
tests/aot/repro/wrong/use_group_function_const.php:8:22: error: expected ';' after expression
tests/aot/repro/wrong/use_group_function_const.php:8:31: error: expected '=' in const declaration
tests/aot/repro/wrong/use_group_function_const.php:10:1: error: unexpected token in expression: CloseBrace
Found 4 error(s), 0 warning(s).
tests/aot/repro/wrong/use_group_function_const.php: parse failed: expected '}' to close use group at line 8, column 21
compile: front-end (parse/typeck/IR) returned null (rc=65)

Tracking

Known-bug repro: tests/aot/repro/wrong/use_group_function_const.php — bash tests/aot/xfail.sh -k use_group_function_const reports XFAIL while this is open and XPASS once it is fixed; then move the repro into tests/aot/cases/ and close this issue.

Activity

  1. added
    bug
    wrong-answer
    on Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugwrong-answer

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions