N°8851 N°8854 - PHP 8.4: Fix explicit nullable in functions parameters + replace trigger_error() usage with E_USER_ERROR#804
Merged
Lenaick merged 2 commits intosupport/3.2from Feb 20, 2026
Conversation
Molkobain
approved these changes
Feb 16, 2026
Contributor
Molkobain
left a comment
There was a problem hiding this comment.
Adding the nullable type hint on a class that can be extended is ok, even though its child classes don't. So we don't have to worry about APIs implementations 🙌
See this 3v4l.org test which tests the following snippet:
class A
{
public function foo(?string $text = null)
{
var_dump($text);
}
}
class B extends A
{
public function foo(string $text = null)
{
var_dump($text);
}
}
$a = new A();
$a->foo('Hello');
$b = new B();
$b->foo('Hello');The other way around works as well, see this 3v4l.org test.
Contributor
|
Ok for merge 🙌 |
8209c95 to
bd42055
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Base information
Objective
To support migration to PHP8.4, we must address the new deprecation rules.
After the initial analysis, the newly deprecated features affecting iTop are :
Proposed solution
?CMDBObject $oObject = nullE_USER_WARNINGChecklist before requesting a review