Skip to content

Constant named OBJECT is lexed as the object type keyword in a default value #430

Closed

Description

@blacktrs

Summary

Constant named OBJECT is lexed as the object type keyword in a default value.

Repro

<?php
define("OBJECT", "OBJECT");
function g($o = OBJECT, $y = 0) { return $o . $y; }
echo g(), "\n";
echo OBJECT, "\n";

Expected (php)

OBJECT0
OBJECT

Actual (manticore 03e183b6, Darwin arm64)

compile failed (rc=65):
tests/aot/repro/crash/const_named_object.php:4:17: error: unexpected token in expression: Keyword
Found 1 error(s), 0 warning(s).
tests/aot/repro/crash/const_named_object.php: parse failed: unexpected token in expression: Keyword at line 4, column 17
compile: front-end (parse/typeck/IR) returned null (rc=65)

Tracking

Known-bug repro: tests/aot/repro/crash/const_named_object.php — bash tests/aot/xfail.sh -k const_named_object 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
    crash
    on Oct 24, 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

    bugcrash

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions