PHP8.1 Deprecation Passing Null to String Function#2137
PHP8.1 Deprecation Passing Null to String Function#2137MarkBaker merged 3 commits intoPHPOffice:masterfrom
Conversation
For each of the files in this PR, one or more statements can pass a null to string functions like strlower. This is deprecated in PHP8.1, and, when deprecated messages are enabled, causes many tests to error out. In every case, use coercion to pass null string rather than null.
|
Idly wondering how much overhead it would add to the calculation engine to use Reflection to read the method signature, and pass in any appropriate default value as defined in that signature if an argument had been left blank, rather than sending a null value to the method.... that way, any null values received by the method could only be the result of a null value cell or an explicit null argument It might be worth an experiment, to see how much overhead it might add in terms of performance... I'll have a go sometime in the coming weeks, just to see if it works out |
|
Spent the weekend working on this as PR #2143 (PR Is still in draft, because I want to clean up the code a bit). It works well, and with the change any null value passed to a function implementation is a genuine null, and not an empty argument... empty arguments are pre-populated with the defined default values for the argument. I still need to run some performance tests, but the overhead doesn't seem excessive |
For each of the files in this PR, one or more statements can pass a null to string functions like strlower. This is deprecated in PHP8.1, and, when deprecated messages are enabled, causes many tests to error out. In every case, use coercion to pass null string rather than null.
For each of the files in this PR, one or more statements can pass a null to string functions like strlower. This is deprecated in PHP8.1, and, when deprecated messages are enabled, causes many tests to error out. In every case, use coercion to pass null string rather than null.
This is:
Checklist:
Why this change is needed?