Skip to content

a reserved word followed by \Name is one qualified name to Zend (echo\A\f() is a call), but the compiler lexes it as the keyword #368

Closed

Description

@blacktrs

Summary

a reserved word followed by \Name is one qualified name to Zend (echo\A\f() is a call), but the compiler lexes it as the keyword.

Repro

<?php
namespace A;

function f(): string { return "called"; }

try {
    echo\A\f();
} catch (\Error $e) {
    echo get_class($e), ": ", $e->getMessage(), "\n";
}

Expected (php)

Error: Call to undefined function A\echo\A\f()

Actual (manticore bc48f7a1, Darwin arm64)

called

Tracking

Known-bug repro: tests/aot/repro/wrong/keyword_backslash_name_is_one_qualified_name.php — bash tests/aot/xfail.sh -k keyword_backslash_name_is_one_qualified_name 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 19, 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