Passing null to non-nullable internal function parameters – Updating Existing Code Base to php 8.1

To answer the bit about the “easiest most time efficient way to handle upgrading this code”. In short, you can’t. First, some background… Roughly 15% of developers use strict_types=1, so you’re in the majority of developers that don’t. You could ignore this problem (deprecation) for now, but PHP 9.0 will cause a lot of problems … Read more

Reference: Return type of … should either be compatible with …, or the #[\ReturnTypeWillChange] attribute should be used

Background: Return types and covariance Since PHP 7.0, it has been possible to specify the return type of a function or method, such as function example(): string to indicate a function that returns a string. This forms a contract that other code can rely on. For instance, this class promises that the getList method will … Read more