Skip to content

crash with incomplete blocks #55

Description

@imuli

When dealing with truncated or otherwise incomplete php files, sometimes the file ends inside a block.

function incomplete() {
    return something();

for some block types - class, switch - it comes out fine, just a syntax error and dropping the entry. For the majority though, - do, foreach, function, if, namespace, while - the parser returns nil and php-parser crashes.

I haven't yet seen an unclosed parenthetical break the parser, but that seems like a possibility too.

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions