Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110617 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 86962 invoked from network); 17 Jun 2020 09:21:48 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 17 Jun 2020 09:21:48 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9A1D51804A8 for ; Wed, 17 Jun 2020 01:07:23 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 17 Jun 2020 01:07:22 -0700 (PDT) Received: by mail-lj1-f169.google.com with SMTP id e4so1742527ljn.4 for ; Wed, 17 Jun 2020 01:07:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Ox8wE5reTsX7b3vajOtermrj60fYbxMSL2mTO3NSNbU=; b=BqjapXQ5hb9M9q+vtULD7xy2XASy5tvRiPh1KC3sMSar1sHQvAdyFa9basMmr/JDyI 6TroEFjHTk4k4wd1Xk/WP5n0MFwIR98/7ShB3rKq3cG/79HXMwu8PIxPtdA65taEe3w1 F+6HDBzbJ+DtC6gidurtebkKUGHf42Tfo3jjnCgzHWMekY21c6qxC/dAwC/Lg2Bu9ITm 26iw+R/KP6FgkWn6uYZuE1eR5sriGu1D5jwUxVKtWbfrjAyLOpl7MeVlP32gLEMnI68g JX5ohToJms6IN8MivVmsYWK4LNF1dJkv4Xz0n3DEMq0iBBkaopng+b8p4k2Vy5K3heBT s9pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Ox8wE5reTsX7b3vajOtermrj60fYbxMSL2mTO3NSNbU=; b=HD7utygAL+UQETeMNhKnDUZt8lqINUfTOPwYkjuwfoSGda99thyO5q8YLM+PUKBDoV EHrqwL8HsQ5ic7nMw86rEFMw2NmAGdZ+WXJgdbq+cafypSKIU2lVyYsHPcdgF0nKD+fV f8g4oCXlds+5tHDz53+lQFKghEVAmCmHyhh79mksxLgGNxwp7DdrVG4EwJyTuprvG2t1 WPjojOQ+rZKTvtNQQtPI8M+q7k0/Q3mFC9Wn7rTgaKJEJT+LwHqEJeaR8utjdpv/dTmz qE36VuAQDGVy+dGuOJ9FANrsBxehiZKajglQXRzqkIe9mQDiCygkAUllD0zVPsHqrFNZ hTmw== X-Gm-Message-State: AOAM531V9OiGlRApDuHIJwuHTQc5XXIhU4RiIxzxeRMOyAj74tiPzwZT TtXIRCM3Z2gNq1ht8e9dtuFrExmVCrkmrktBDPM= X-Google-Smtp-Source: ABdhPJxkH88JEYRSt369UQ558uBOAljMoMOJ4nYGnhBz6llKXK1sKKu067jzVZOzOxS7aDuU8NyvvAMNT8uLy+nXn68= X-Received: by 2002:a2e:9cd2:: with SMTP id g18mr3737206ljj.81.1592381239888; Wed, 17 Jun 2020 01:07:19 -0700 (PDT) MIME-Version: 1.0 References: <8ADA2EC7-EE07-4429-8F84-1E5ADC7660E6@cschneid.com> In-Reply-To: <8ADA2EC7-EE07-4429-8F84-1E5ADC7660E6@cschneid.com> Date: Wed, 17 Jun 2020 10:07:03 +0200 Message-ID: To: Christian Schneider Cc: Benas IML , PHP Internals List Content-Type: multipart/alternative; boundary="000000000000268f3a05a84326d1" Subject: Re: [PHP-DEV] [RFC] [DISCUSSION] Allow void return type for constructors/destructors From: nikita.ppv@gmail.com (Nikita Popov) --000000000000268f3a05a84326d1 Content-Type: text/plain; charset="UTF-8" On Wed, Jun 17, 2020 at 9:18 AM Christian Schneider wrote: > Am 16.06.2020 um 21:30 schrieb Benas IML : > > I put the original RFC on hold and created a new PR [0] for implicitly > > enforcing `void` rules on both constructors and destructors. Note, that > > this results in a BC break since it is no longer legal to return non-void > > value from constructors/destructors. In other words, it is now illegal to > > return something from ctor. > > This is a huge BC break as up to now returning something in a constructor > was silently ignored. > Therefore I'd strongly advise to go through a deprecation phase > (E_DEPRECATED or E_WARNING) before making it a fatal error so old software > can be fixed first. > I analyzed the top 2k composer packages, and found 95 places that would be affected by making __construct implicitly void: https://gist.github.com/nikic/e0d7c9c810e15b843ffd7d6779a2e49a Common cases seem to be "return parent::__construct()", "return $this" and "return false". There's not a lot of them, but I do tend to agree that starting out with a warning would be better. Regards, Nikita --000000000000268f3a05a84326d1--