Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127557 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id D7C9C1A00BC for ; Tue, 3 Jun 2025 14:55:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1748962419; bh=XsZItahi3rErPHrALC79OcxNdAkgQzUj9Qnx1NeOEwQ=; h=Date:To:From:Cc:Subject:In-Reply-To:References:From; b=D4BcMvli3sTlzTYetXjD2Fc8kwUPMuWcUPpDOo8txcRFMLkaflduENXdCC6rFoabZ InKgTqay9Ou9TQnW3CuJabQ4HAmuCqJApUmhw6ZjyYbZiYhTU/81ae++GFWqqZ1WVW QUaCqzo1ZHN/uOE67o571hnvaZiu9FvRZr3H+lNGwIoaSUcAnw6q6T79//kdezanSk evxCtf8Q2jltrBBBdnRoeCgUU24oaSrUDoPOytq3HWgWAR5qFjVKIfu8J8v+yJ1QCX 9S3NZn7P2efB8Q7+zOvJnASZVcNP4NqMXo+ai8FkpW771WTC5VIQDO0XgcRlem8qNI nYKtUHjgkVmxQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id AAEFA180585 for ; Tue, 3 Jun 2025 14:53:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from mail-24420.protonmail.ch (mail-24420.protonmail.ch [109.224.244.20]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 3 Jun 2025 14:53:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gpb.moe; s=protonmail3; t=1748962539; x=1749221739; bh=XsZItahi3rErPHrALC79OcxNdAkgQzUj9Qnx1NeOEwQ=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post; b=bzgfexZ+v3XDhAwiVY847jqWxSqe6DSTJc8zxSAGPuoR9ywYNwboyU4eHC3RQI/uz vCN3Dt9WQqp735p4t/igdxGsvHgPM8aMoIQpCQgMTUhIRkk+Cjo8Tjs4yC3r8mTyiF GrYJcj2YZExBoGh8NBKh/vCzHgbfHe31Z7MnDzrfOu79MySelRbSebig8GPEQTVhWH I74QPXyNHY4Akk1tA45JveQA//zB5ovICTx5AX540qG6e2HnF6h6M0xIF8wEASRAW+ uli2JgXCrUQrKXftPsmt2WmfQdDw+L+8aXgwm8VQAWm4P+ojGRK2tWhkRxbXP7zOBv NToP4hT1F8CUg== Date: Tue, 03 Jun 2025 14:55:33 +0000 To: Kamil Tekiela Cc: Larry Garfield , php internals Subject: Re: [PHP-DEV] [RFC] Transform void into an alias for null Message-ID: In-Reply-To: References: <6Z2Ysh6MjYp1nyzuB0bTPJc5srObIcMRqt731JaQeXUJk1f_V_Yo2nRn8WvjI7er7pp7pIUE6WYl5pRwvYrtcrd07nCutyAqKPSsZHmrS-Y=@gpb.moe> <6ef43d7f-711a-46d5-b2a5-b6919feabd93@app.fastmail.com> Feedback-ID: 96993444:user:proton X-Pm-Message-ID: 3a1fdb87be93df75cfc89491ffab4281ee81f69a Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: internals@gpb.moe ("Gina P. Banyard") On Monday, 2 June 2025 at 18:08, Kamil Tekiela wrote= : > The RFC mentions that this will now become valid: >=20 > function foo(): void { > return null; > } >=20 > But what about the opposite: >=20 > function foo(): null { > return; > } This would also work indeed. > or what Larry was trying to suggest: >=20 > function foo(): null { > print 'test'; > } >=20 > $val =3D foo(); This would also work, as null and void would be isomorphic. However, if you have a return type of T|null then you'd get errors in both = cases. I will clarify this in the RFC. Best regards, Gina P. Banyard