Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127560 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 E1EF71A00BC for ; Tue, 3 Jun 2025 15:20:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1748963933; bh=l6+DwLwITED+8Sz2KN2k2FnYaT1JhxGTeX2X6i5CDmw=; h=Date:To:From:Cc:Subject:In-Reply-To:References:From; b=evYKGMhVO+owUYhkx33QnrAtuAGl/dKkRGaZjR4U7eKM3kUu52XhDLYnwse6rNuSe QeVrDPRle8DNYuUBOy0ctcSFJWAQa5QCtC2tDJthvkSjxn2+WP3hMeH4cCwKqfR34U XV+VxmiMnFG5XOO+fCUwMhEnLb/XrQqq7D3DHxyzlzAgSHuqGgiuXZiLXynn1LkmsJ z8aYzniwIo73Br5z/YcmPdk0ySN8Xust686wgq3EsooAiEplIleDg2ZGEFTDaKaTkH lHpYMZpjh7VnlfS1j9SUqmlmeg5XCtVvu2QztiqO2PHN1QxCoUu7Ko1Q3ym5NlNM4Z d/hpH5ckxGyPQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 36115180082 for ; Tue, 3 Jun 2025 15:18:52 +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-24421.protonmail.ch (mail-24421.protonmail.ch [109.224.244.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 3 Jun 2025 15:18:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gpb.moe; s=protonmail3; t=1748964054; x=1749223254; bh=l6+DwLwITED+8Sz2KN2k2FnYaT1JhxGTeX2X6i5CDmw=; 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=scyxcEP3OSWgrHRh5H/CIkST4l5ArAiiVWuYms267ElMnxIgXJIlOhkXC6pEqixAI DmodMnvPVVAOrejIxyXPi+QzBzrHPYRIt+b7waYBprn8H9wsg2Y/nIQxgXABhjMgUh VdlF3/viX0VZPyS1V2eD0daupmxcL3N6UwkcAbvYRwaNnHT139I8tGpBkXC2Epo9K3 2p+xrQBs/v0srwImiY01vEFmxMb/l3/NjJScnO0kcc+2kaCmVnUMqrIhMtPkaXLoRZ 8VH0nfRI8EGSJeZx7BUu9L31xuPrin+NlWFtMZAMkhEFT4X4fRcGveIcNZIwsiHVr6 XNuJ5thAb/Ytw== Date: Tue, 03 Jun 2025 15:20:48 +0000 To: Anton Smirnov Cc: internals@lists.php.net Subject: Re: [PHP-DEV] [RFC] Transform void into an alias for null Message-ID: <9CMD5Mjh0unmR6G9NjfMonV9S7q8KQ9F29o8OdcndyaZ4_sOMOGuQU8chWKRdz6LYwslYWnuWM069sWhWt8ZTFRiQluEWqjZOXME0UZ2Zrc=@gpb.moe> In-Reply-To: <0ac00d42-7584-4de2-bca4-9099f3d4cbb5@sandfox.me> References: <6Z2Ysh6MjYp1nyzuB0bTPJc5srObIcMRqt731JaQeXUJk1f_V_Yo2nRn8WvjI7er7pp7pIUE6WYl5pRwvYrtcrd07nCutyAqKPSsZHmrS-Y=@gpb.moe> <7f7dc3dc-bb9a-4f6e-9b77-055c4a8801d1@rwec.co.uk> <0ac00d42-7584-4de2-bca4-9099f3d4cbb5@sandfox.me> Feedback-ID: 96993444:user:proton X-Pm-Message-ID: dc1e24377571c45bbd406b142fc430d2404132c6 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 Tuesday, 3 June 2025 at 02:36, Anton Smirnov wrote: > On 02/06/2025 23:50, Rowan Tommins [IMSoP] wrote: >=20 > > I agree the type hierarchy you describe is weird, but rather than > > throwing away the functionality completely, I wonder if we can make it > > more consistent: > >=20 > > - Make "no return type declared" and "mixed" equivalent > > - Make "void" a sub-type of "null", and therefore a sub-type of "mixed" >=20 >=20 > I think that null and void are semantically very different so I'd like > to suggest just making void subtype of mixed. This will both keep the > semantic meaning of void and make mixed and undeclared mean the same thin= g. You are going to need to expand on why you think those two are semantically= very different. PHP does not have the concept of "execution control is returned to the call= ing scope, but no concrete value is returned". And this is a good thing IMHO, as it means you can always take the result o= f a function. Moreover, "just making void subtype of mixed" can mean everything and nothi= ng. Do you mean for void to live on its own island like the int or string types= ? Make it a subtype of null like Roman suggested? Have void be a super type of some weird union of types representing scalars= int|string|float|bool? Something else altogether? Best regards, Gina P. Banyard