Skip to content

Conversation

@xHeaven
Copy link
Contributor

@xHeaven xHeaven commented Feb 9, 2026

This PR fixes a Windows-only crash.

The lexer advances one character at a time, however the previous check depended on PHP_EOL. On Windows, PHP_EOL is \r\n (2 characters), which caused inconsistent whitespace checks at CRLF boundaries and crashed during view rendering.

@xHeaven xHeaven requested a review from brendt as a code owner February 9, 2026 10:58
return $seek;
}

private function isWhitespace(?string $value): bool
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand the use of a function, but this will actually have a pretty significant performance impact. Anything done within the lexer should will be called thousands and thousands of times, and introducing a single function call actually has a measurable performance impact. Since the actual change is minimal, I'll close this PR and add it myself.

Let it be known though that I really appreciate the effort debugging this 🙏

@brendt brendt closed this Feb 9, 2026
@xHeaven xHeaven deleted the windows-lexer branch February 9, 2026 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants