Skip to content

token_get_all(..., TOKEN_PARSE) never throws ParseError #65

Open

Description

@blacktrs

Summary

token_get_all(..., TOKEN_PARSE) never throws ParseError.

Documented divergence in prelude/tokenizer.php; proposal: run the compiler's own parser when TOKEN_PARSE is passed. Decision pending.

Repro

<?php
try { token_get_all('<?php if (', TOKEN_PARSE); echo "no error\n"; } catch (ParseError $e) { echo "ParseError\n"; }

Expected (php 8.5)

ParseError

Actual (manticore 10affa68, macOS arm64)

no error

Tracking

Known-bug repro: tests/aot/repro/wrong/token_get_all_parse_error.php — bash tests/aot/xfail.sh -k token_get_all_parse_error 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 5, 2026
  2. added
    needs-design
    on Oct 13, 2026
  3. blacktrs commented on Oct 13, 2026

    @blacktrs
    ContributorAuthor

    Scope: needs a parser in the prelude. token_get_all(..., TOKEN_PARSE) must throw ParseError, which needs a PHP parser available to the tokenizer extension at run time. Skipped in batch C.

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

    bugneeds-designwrong-answer

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions