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

[8.x] Align PHP 8.1 behavior of e() #36262

Merged
merged 1 commit into from
Feb 15, 2021
Merged

Conversation

kylekatarnls
Copy link
Contributor

While not explicitly allowed in the PHPDoc, e(null) returns "" with PHP < 8.1
On PHP >= 8.1, an error is thrown if null is passed to htmlspecialchars.

As e(null) is still a common case (for instance via Blade in view templates) I think it's safest to just default the null value to an empty string to get the same behavior with the next PHP minor version.

While not explicitly allowed in the PHPDoc, `e(null)` returns `""` with PHP < 8.1
On PHP >= 8.1, an error is thrown if `null` is passed to `htmlspecialchars`.

As `e(null)` is still a common case (for instance via Blade in view templates) I think it's safest to just default the `null` value to an empty string to get the same behavior with the next PHP minor version.
@kylekatarnls kylekatarnls changed the title [8.x] Align PHP 8.1 behavior [8.x] Align PHP 8.1 behavior of e() Feb 14, 2021
@taylorotwell taylorotwell merged commit aedc04c into laravel:8.x Feb 15, 2021
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.

None yet

2 participants