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

changes for PHP 8.4 #255

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

changes for PHP 8.4 #255

wants to merge 1 commit into from

Conversation

Egorskov
Copy link

@Egorskov Egorskov commented Dec 8, 2024

Deprecated: Functional\some(): Implicitly marking parameter $callback as nullable is deprecated, the explicit nullable type must be used instead in /Users/egorgorskov/php-project-48/vendor/lstrojny/functional-php/src/Functional/Some.php on line 25
The deprecation warning we are encountering, “Implicitly marking parameter $callback as nullable is deprecated,” is a result of changes introduced in PHP 8.4, which explicitly requires developers to declare nullable types instead of relying on implicit nullability. This change affects any function or method that previously allowed a parameter to default to null without explicitly defining it as nullable.
Solution:

function example(?callable $callback = null) {
    // function
} 
or for PHP 8.@
function example(callable|null $callback = null) {
    // function
} 

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.

1 participant