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

Hard crash in PHP 7.4 #234

Closed
bobrundle opened this issue Feb 11, 2020 · 6 comments
Closed

Hard crash in PHP 7.4 #234

bobrundle opened this issue Feb 11, 2020 · 6 comments

Comments

@bobrundle
Copy link

Validating any email address in PHP 7.4 raises exception "Trying to access array offset on value of type null" in Parser.php at line 147

    if ($previous['type'] === EmailLexer::S_BACKSLASH

This is result of $previous being null for first character in string and new PHP 7.4 behavior "Trying to use values of type null, bool, int, float or resource as an array (such as $null["key"]) will now generate a notice"

Fix is to check for null...

    if ($previous != null && $previous['type'] === EmailLexer::S_BACKSLASH
@egulias
Copy link
Owner

egulias commented Feb 12, 2020

See #228

@egulias egulias closed this as completed Feb 12, 2020
@rimbaborne
Copy link

thankz

1 similar comment
@GeneralisAblon
Copy link

thankz

@ricardo
Copy link

ricardo commented Sep 8, 2021

thankz

I ran composer update and it fixed the issue.

@carlo-quiamco
Copy link

salamat <3

@Aklnegale
Copy link

This is what you want to write. Watch the format!! if ($previous != null && $previous['type'] === EmailLexer::S_BACKSLASH

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

No branches or pull requests

7 participants