Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110606 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 98920 invoked from network); 16 Jun 2020 20:45:42 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 16 Jun 2020 20:45:42 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A7759180544 for ; Tue, 16 Jun 2020 12:31:12 -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-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) (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 ; Tue, 16 Jun 2020 12:31:12 -0700 (PDT) Received: by mail-lj1-f176.google.com with SMTP id 9so24962073ljv.5 for ; Tue, 16 Jun 2020 12:31:12 -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; bh=rW+dHMa4Ktzo2kZjiZtEl2qHEs/3OYqMma4H4cH3BVk=; b=spcWRZSas8VZkPvWJcew/44+J1Kmf1awsETmY5POjf/awTxWqDtZDXpNwZg8bGWGzO dhscHBlnuqyu/pTWgNk84Rd80EAFU9cU51tOAlKaHUt9MwXi4LYLlMt8A9Kx4/4d6dkr QVnoGyIm5aO74E+/befycsdASUAAJG7+MZ+ViN0+mrLC3GbRKa9zt0iiVYKhbk+d6Mhx IOq4EqpFzttF3lCvmPMB7iu3oOHUNt89uSBQb8wR7p7DJ3VDopkeLm7Hkt3ovx9XjcQx YvPVUta/AlZLE+53p6YWN5n7CPF2rRGcGMZFaikpeKgn2JmT4lsAVgVThV86fE7cJ4+W sYYw== 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; bh=rW+dHMa4Ktzo2kZjiZtEl2qHEs/3OYqMma4H4cH3BVk=; b=VtWkIVVLkCNRZPGW6p6GIsc2mDtwuK6IDCXQstDs8w6NzvDdLOSt5hkpxk/jVslzra +CCo9ckxg82Ao3nSOl6cOX6yr7MCWbQ7HekuAP4xbOTefrTL09wzFkAZH86wdj5WAXc+ QaxptXHYJ1Z26Cc55zx21uKm7TPkScsZAjZ7Hrjca86Bq6y4hUWWpL5Dbb5aI8EW33fX VQ8Tx4APnNgFnpQRTRqOt2lDhrAxyqEjTgZXUtyuSud/6O6q1/nUYPbzT9mqMZ7jej9/ k7brv7O8lQxN8Z8WUKkaV93HVp4H14XIMwkx8f9YtGuSOl8fur2cAOmLsOn2rx9NjfTO JVlA== X-Gm-Message-State: AOAM530jyy0HfFPqglYG9FiK37r7fPDfSlX9yGt4Dz1GCryudzjaX6yG UvanSAQ8fQz/71XlUdIuSNJu9aSkuEa1ov6LBBPeHA== X-Google-Smtp-Source: ABdhPJwZgnVuGV9zO/2sX3VpcpP/foDCl0xcsCcz6mNJqjNqIWhvhSeWRDBpvttejt3IagueKxlk/fYNIwn7Re8jnlM= X-Received: by 2002:a2e:581a:: with SMTP id m26mr2239381ljb.0.1592335868982; Tue, 16 Jun 2020 12:31:08 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 16 Jun 2020 22:30:56 +0300 Message-ID: To: PHP Internals List Content-Type: multipart/alternative; boundary="000000000000d587fb05a8389540" Subject: Re: [RFC] [DISCUSSION] Allow void return type for constructors/destructors From: benas.molis.iml@gmail.com (Benas IML) --000000000000d587fb05a8389540 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hey internals, 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. As a side bonus, it is also allowed to explicitly declare both `__construct()` and `__destruct()` as `void` (but this is by no means mandatory, it's optional). I'm not sure whether this needs a proper RFC since this is more of a patch (fix: #79679) than a new feature, so let me know! This PR should also address all of M=C3=A1t=C3=A9's concerns since it makes constructors and destructors always return `void` (even when no explicit `void` return type is specified). Best regards, Benas Seliuginas On Tue, Jun 16, 2020, 3:34 AM Benas IML wrote: > Hey internals, > > I am proposing to allow void return type for constructors/destructors. > Note, > that this is an **optional** and cosmetic-only addition! All of the > reasoning > is in the RFC. > > RFC: https://wiki.php.net/rfc/constructor_return_type > > Best regards, > Benas > --000000000000d587fb05a8389540--