Skip to content

Conversation

derekmd
Copy link
Contributor

@derekmd derekmd commented Mar 27, 2022

Fixes #41643

Blade directives @includeOnce() & @pushOnce() can raise a deprecated notice in PHP 8.1:

trim(): Passing null to parameter #1 ($string) of type string is deprecated

Instead fallback to empty string ''.

trim() no longer accepts null arguments because reasons.
@derekmd derekmd changed the title [9.x] Remove PHP 8.1 deprecated notice in @pushOnce() & @includeOnce() [9.x] Remove PHP 8.1 deprecated notice in @pushOnce() & @includeOnce() Mar 27, 2022
@GrahamCampbell
Copy link
Collaborator

I think this PR is targetting the wrong branch. Laravel 8 is still receiving bug fixes, and supports PHP 8.1, so this PR should instead be targetting the 8.x branch.

@derekmd
Copy link
Contributor Author

derekmd commented Mar 28, 2022

#40738 was added in 9.x.

https://github.com/laravel/framework/pulls?q=is%3Apr+commenter%3AGrahamCampbell+wrong

@GrahamCampbell
Copy link
Collaborator

https://github.com/laravel/framework/pulls?q=is%3Apr+commenter%3AGrahamCampbell+wrong

What is that supposed to mean?

#40738 was added in 9.x.

Great, thanks for double checking. That was important information to include in the OP.

@taylorotwell taylorotwell merged commit 633433f into laravel:9.x Mar 28, 2022
@derekmd derekmd deleted the fix-blade-push-once-deprecated-notice branch March 28, 2022 14:16
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.

PHP 8.1: Passing null to non-nullable parameters of built-in functions is deprecated

4 participants