Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash with incomplete blocks #55

Open
imuli opened this issue Jul 16, 2018 · 0 comments
Open

crash with incomplete blocks #55

imuli opened this issue Jul 16, 2018 · 0 comments
Labels

Comments

@imuli
Copy link
Contributor

imuli commented Jul 16, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants