Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110598 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 53587 invoked from network); 16 Jun 2020 15:57:33 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 16 Jun 2020 15:57:33 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 68ABC18056A for ; Tue, 16 Jun 2020 07:42:58 -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-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (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 07:42:57 -0700 (PDT) Received: by mail-lf1-f45.google.com with SMTP id m26so840998lfo.13 for ; Tue, 16 Jun 2020 07:42:57 -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=HGMll+OXHvqro9fcucgLJLwg5Y6reAaW0tLUGY9EhNI=; b=AguoOA817Bldd7AxIxm1rKI6HtRzG+CsPqALEc5dwdeGo4JMRbuXVbmdw2tJA50GQF JNCP0CKEsN6HeLX6bx3cu4yV9k6680m/9FucsNYa1Eyt6LIKIJl9nB2bJ4WttIwzddJx kcbJSJFpNm9KnbEvK+LTmW8VeESPgB1D694y3h9W7RBJPVARL7kHzT7OTUcyC/IfVaE1 2L9+ZfVYGDMZ2vv3w05hFb6HDiJWa9mk3oxPEAItDTnX2G6wcBBz2/eyFunGX+wSlgAy RqJmvs+35NbTKVsZEwdCKenEzyZvsleHjCMdEg3W2GSe5/wGp4Ud9dNjoqu3EI9kLaei IIFA== 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=HGMll+OXHvqro9fcucgLJLwg5Y6reAaW0tLUGY9EhNI=; b=DtPd5wdHPTPlVBRMHuQR8PnNPBHTClp4OSY0VOcqYtEvkxlC+HWACnGcDAnyR2FvEg qB1uKiY6lqhJoUrrevnGjtCoCYjqXSN5VDgwTDG1O+eHbyZM0zQD/dwvK3Qv4MhpTU8e FgMRlANcBZ4ijHcubWz83DSAD95ch6j1YQgBwMANlEeJSxQEhe7WpXbHip4zC3D35c4v LN655epr039PKRr7cirOjXYeEqw0+s9sALIwOqJCVmXO7vuK7xlUYBFhefGkej+Fgsl8 Tu2cIgyQYBmCWgDH3TFn0DzhVNPQCVOCwEMbnJlwr7PI9bhwm198MAykaRFB0Doib7VZ ARRA== X-Gm-Message-State: AOAM533bwIh0FNk0luo7rGpftpHqOjvJr75on/JwH3VbiO3pRlB4Mmia GDXVFxcQdeScYoFYckzwS1hWgIhmOxYHQfiyZts= X-Google-Smtp-Source: ABdhPJxK43QxTh3ndcP/oQ7GJQIR+UwZV6/PbDrewVoPZdjU0b5K99Vb8W7yzyT2raSkLKTSyecny4lpRQBZ5JnROKM= X-Received: by 2002:ac2:4c2a:: with SMTP id u10mr1900452lfq.168.1592318576489; Tue, 16 Jun 2020 07:42:56 -0700 (PDT) MIME-Version: 1.0 References: <41a79208-f165-451c-4815-60daa432286f@gmx.de> In-Reply-To: <41a79208-f165-451c-4815-60daa432286f@gmx.de> Date: Tue, 16 Jun 2020 17:42:43 +0300 Message-ID: To: "Christoph M. Becker" Cc: Dan Ackroyd , =?UTF-8?B?TcOhdMOpIEtvY3Npcw==?= , "G. P. B." , PHP Internals List Content-Type: multipart/alternative; boundary="0000000000001f20c005a8348fc2" Subject: Re: [PHP-DEV] [RFC] [DISCUSSION] Allow void return type for constructors/destructors From: benas.molis.iml@gmail.com (Benas IML) --0000000000001f20c005a8348fc2 Content-Type: text/plain; charset="UTF-8" Nope, that isn't changing. I simply wanted to point out that this RFC is proposing to allow to declare constructor return type as `: void`, but not as `: mixed`. The entire RFC is just a matter of cosmetic addition allowing to add `: void` to constructors/destructors (for those that want to). It seems that I will have to rewrite the BC section to be more clear on that. Best regards, Benas On Tue, Jun 16, 2020, 5:36 PM Christoph M. Becker wrote: > On 16.06.2020 at 16:19, Benas IML wrote: > > > I meant something like this: > > ``` > > > class Test { > > public function __construct() {} > > } > > > > class Test2 extends Test { > > /* this is legal */ > > public function __construct(): void {} > > } > > > > class Test3 extends Test { > > /* > > * this is illegal, even though no > > * return type means mixed|void > > */ > > public function __construct(): mixed {} > > } > > > > class Test4 extends Test2 { > > /* > > * this is legal, even though we are > > * widening void type to mixed|void > > * but LSP checks don't apply to > > * constructors and destructors > > */ > > public function __construct() {} > > } > > ``` > > Currently, constructors are exempt from LSP checks[1]; are you planning > to change that? > > [1] > > -- > Christoph M. Becker > --0000000000001f20c005a8348fc2--