Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127960 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 36B681A00BC for ; Wed, 9 Jul 2025 00:47:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1752021933; bh=ikFrkz5JKYWGuZnQoWIRsEISpxR4HaD3Vtv1F8P2r3Y=; h=To:From:Subject:Date:From; b=LwS7gl6SpNR5AQcnCONpnUDzzR8sHvlohxRuaE7fMOVcuv26Jzgmhvi30VPWB1/U1 D6qxEsLPIFi3rS9c3jBxR0mjmsMr9jHJzUK+RM9ykUCCIxdtyTPTtNTR8p9Ta8lvQR 1HiOzPB7WSpSOUpYkWaJVkUjrSiMHdJjWrIBdlOp52vxlpvegRHhUhpr8rCMnkfvsq RVhX+cNNJXMc2S8YpqdzOksrs8t+xm9hdg8I4OlUy0rhqTP0Z45LLAO4IF2A/RLiIO +iFGq22PtkhWOGe3XE28MmdudYvViZR8s3+max3NtSFbNFMJn2VTVKKqiQp5ykPYbz Q9eFwYEALBXsQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4393D180074 for ; Wed, 9 Jul 2025 00:45:32 +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=3.5 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_50, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_SOFTFAIL 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 baboon.pine.relay.mailchannels.net (baboon.pine.relay.mailchannels.net [23.83.219.8]) (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 ; Wed, 9 Jul 2025 00:45:31 +0000 (UTC) X-Sender-Id: a2hosting|x-authuser|juliette@adviesenzo.nl Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id BC4CA162804 for ; Wed, 9 Jul 2025 00:47:20 +0000 (UTC) Received: from nl1-ss105.a2hosting.com (trex-green-9.trex.outbound.svc.cluster.local [100.111.79.38]) (Authenticated sender: a2hosting) by relay.mailchannels.net (Postfix) with ESMTPA id 56A2A162621 for ; Wed, 9 Jul 2025 00:47:19 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1752022039; a=rsa-sha256; cv=none; b=lZahzPOHn+vhYg7NrdopvS4vHwMMKxxVZtZkov0wIFPasLm8SGoGzQriNnbJ2GwZjlu/Ja SKZZHH2Lsn9ycfQQy8xTEuQ9ebCUXBkmEX2oPeUOwrgIjR48T1I+04n15UImDR7VFbj6e1 caOQzYZi5Y9cSIPw6qvoBzuHCFN/oG+y4xp0AxiADcTqxSmNJE3oI6sIIFrz1up+JQ7v0L h7U596+T8JJAHEd8p2uylhF40IrKCsTM27Ls/tzDUpG/is8mR0li0KMMUT297mBHUe3Y38 z8okaBCXvSiKgR4STRLF3uaoBiwqO/0Z9t0j8q1SMVA133Hv8eJmnxDcPMAQHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1752022039; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: dkim-signature; bh=Ynx2gxwtSZvvXvEhD/2UJdl4ixKUss3610uquPGoUw0=; b=HzdJvbdo7vqZuaK8jtIl38MyZYFfhC0hpkfiQllDWTXp2vuhdO7kzt50qm6eyIZ20SVZMu hYE0/NkIFEIiE3vC5Lw9r+LsxTATGijPTizSWwENyV2Ynn7Q99YQvE8GiPrUroBOQ9B6YI rSaxXtI+V/Yts906HCD0ggCNGJW99K+wBLZ0cvGp0H/yvN4wwhJ0HTVHqVkiUbnl12PlLd OcwhNIyg9Rjmix/ruvq6hAW7Yf0Qt42grjYfdTkEUaBrv1NN2m3GWXrEL8lXD+HUWL70LG U7jpD4g8wVNbu3BdSPWrZEEVyt5a5sFuRP/TECBlScF9sixXsMZH6Sg7U3uOQQ== ARC-Authentication-Results: i=1; rspamd-57f6596c64-lwsnm; auth=pass smtp.auth=a2hosting smtp.mailfrom=php-internals_nospam@adviesenzo.nl X-Sender-Id: a2hosting|x-authuser|juliette@adviesenzo.nl X-MC-Relay: Bad X-MailChannels-SenderId: a2hosting|x-authuser|juliette@adviesenzo.nl X-MailChannels-Auth-Id: a2hosting X-Descriptive-Celery: 4b37e6904913d9cc_1752022039857_3403871455 X-MC-Loop-Signature: 1752022039857:2086312845 X-MC-Ingress-Time: 1752022039857 Received: from nl1-ss105.a2hosting.com (nl1-ss105.a2hosting.com [85.187.142.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.111.79.38 (trex/7.1.3); Wed, 09 Jul 2025 00:47:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=adviesenzo.nl; s=default; h=Content-Type:MIME-Version:Date:Message-ID: Subject:From:To:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Ynx2gxwtSZvvXvEhD/2UJdl4ixKUss3610uquPGoUw0=; b=tjDulgHHzHfoRxYAmWn+unPdPU COmoXbKnxQACjqG6NOIhyj4xFZxI9G6fqZL7xQ1gRPjYeDhvw+1UNUVS5HoMiHoWEJv+x/ds8k3rI paNZnYv5i59233hR3kP+FHdQvJVvW1AwtH4mfBCrTSlmdy+iCj1pKubHfVPJ2pLp+eBw=; Received: from mailnull by nl1-ss105.a2hosting.com with spam-scanner (Exim 4.98.2) (envelope-from ) id 1uZIxx-00000004IfU-1SIm for internals@lists.php.net; Wed, 09 Jul 2025 02:47:17 +0200 X-ImunifyEmail-Filter-Action: no action X-ImunifyEmail-Filter-Version: 3.8.16/202507071239 X-ImunifyEmail-Filter-Score: 2.12 X-ImunifyEmail-Filter-Info: UkNWRF9UTFNfQUxMIFJDVkRfVklBX1NNVFBfQVVUSCBNSURf UkhTX01 BVENIX0ZST00gRlJPTV9IQVNfRE4gVE9fRE5fQUxMIFNVQkpFQ1RfRU 5EU19RVUVTVElPTiBSQ1ZEX0NPVU5UX09ORSBGUk9NX0VRX0VOVkZST 00gQkFZRVNfSEFNIElFX1ZMX1BCTF9BQ0NPVU5UXzA1IEFTTiBBUkNf TkEgTUlNRV9VTktOT1dOIE1JTUVfVFJBQ0UgUkNQVF9DT1VOVF9PTkU gSUVfVkxfUEJMX0FDQ09VTlRfMDEgVE9fTUFUQ0hfRU5WUkNQVF9BTE wgVkVSSUxPQ0tfQ0I= Received: from [31.201.40.213] (port=49208 helo=[192.168.1.16]) by nl1-ss105.a2hosting.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1uZIxy-00000004ITH-0eKJ for internals@lists.php.net; Wed, 09 Jul 2025 02:47:17 +0200 To: php internals Subject: [PHP-DEV] Deprecate return by reference from never ? Message-ID: <686DBC13.4010704@adviesenzo.nl> Date: Wed, 9 Jul 2025 02:47:15 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------090501010009070107050803" X-AuthUser: juliette@adviesenzo.nl From: php-internals_nospam@adviesenzo.nl (Juliette Reinders Folmer) This is a multi-part message in MIME format. --------------090501010009070107050803 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit L.S., I just noticed something which seems odd to me: PHP 8.1 deprecated declaring a function to return by reference when the return type is void: `function &foo() : void {}` results in: "Deprecated: foo(): Returning by reference from a void function is deprecated" However, declaring a function to return by reference when the return type is "never" does not yield either an error or a deprecation notice: https://3v4l.org/DWs7t I might well be missing something, but this feels a bit strange and inconsistent to me. Should this be fixed by also deprecating return by reference for "never" functions ? Smile, Juliette --------------090501010009070107050803 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit L.S.,

I just noticed something which seems odd to me: PHP 8.1 deprecated declaring a function to return by reference when the return type is void:

`function &foo() : void {}` results in:
"Deprecated: foo(): Returning by reference from a void function is deprecated"

However, declaring a function to return by reference when the return type is "never" does not yield either an error or a deprecation notice: https://3v4l.org/DWs7t

I might well be missing something, but this feels a bit strange and inconsistent to me.

Should this be fixed by also deprecating return by reference for "never" functions ?

Smile,
Juliette

 



--------------090501010009070107050803--