Skip to content

token_get_all() does not lex the (binary) cast as T_STRING_CAST #358

Closed

Description

@blacktrs

Summary

token_get_all() does not lex the (binary) cast as T_STRING_CAST.

Repro

<?php
echo token_name(token_get_all('<?php (binary) $a;')[1][0]), "\n";
echo token_name(token_get_all('<?php (Binary) $a;')[1][0]), "\n";

Expected (php)

T_STRING_CAST
T_STRING_CAST

Actual (manticore 273ebde7, Darwin arm64)


[exit code 255]
PHP Fatal error:  Uncaught TypeError: Argument must be of type int, string given

Tracking

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