On 8-5-2026 10:44, Tim Düsterhus wrote:
following Rowan’s request from the earlier “let the "new" operator
fail when the __construct( ) function returns a value” discussion [1],
I have now created a dedicated RFC to deprecate returning values from
__construct() and __destruct().
Please find the RFC text at:
https://wiki.php.net/rfc/deprecate-return-value-from-construct
As I mentioned in my earlier message about this topic [1], a
PHP_CodeSniffer sniff already exists to forbid this.
For lack of an impact analysis in the RFC, I've now used this sniff to
create an impact analysis [2] based on the Packagist 4000 as downloaded
by me some two months ago.
Configuration used and full scan results are available in the gist.
Smile,
Juliette
[1] https://externals.io/message/129980#130043
[2] https://gist.github.com/jrfnl/6782310676b7ff5942f97873a71552ea