Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:128265 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 041E01ADA9C for ; Mon, 28 Jul 2025 14:21:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1753712367; bh=VHpfF8G+axIynE1FQGIP3ALCmq9TWx7wuPBiAEJh1pY=; h=Date:To:From:Cc:Subject:In-Reply-To:References:From; b=QBNGlUF8NwaTFpmbCVh3Ekz9r0p+tF6fwKbUKMtfiFTZP/TMY5c9jqF8ODybl/Ku7 8mI8hhIy5C54rXV5ALhGHo8diiZ9gtiN3U8H8cUjn2UwHwfJYD+BOH3PGNCBMn8rqA VrpqkeLelVsH9BjxjJRxSiEdwB+D7mSpPJ9gA0YXDjK/wtwbosUVOxoDqNOlxP4ffw 3n8nLmF24CJWMCVjCg59YvLCoO6AH/ErM7Jk+DuIHMX1bE2JElLhy7g0PalGNzuTJe mQD0Rs64TStwrcxjPo+s0QoMmDhvTMHqNgT1qxdZDWFc0JW62cGpFEucs317hBoHvR PSLutkZI70XxQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D1B41180611 for ; Mon, 28 Jul 2025 14:19:25 +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.1 required=5.0 tests=BAYES_00,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-10626.protonmail.ch (mail-10626.protonmail.ch [79.135.106.26]) (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 ; Mon, 28 Jul 2025 14:19:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gpb.moe; s=protonmail; t=1753712463; x=1753971663; bh=VHpfF8G+axIynE1FQGIP3ALCmq9TWx7wuPBiAEJh1pY=; 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; b=lwEn/ObNmB1Y09dH1G7n1q60K1BgOWLstpknLXCOBgAqs+2+I2wVdQvfaUZZ4AemG 7IqGGk3P5JdhSVSW1+tYMZ0SpcxRLbJ4PiSiPihfTJ+2b2d5s2V+ePy3mHfAGHP6FH tEWGbgwBjc+vMn8IKWp9CUjEzXKsnC6EiXs2xSmlgDnp+FMpHQ0568500MayPrj10K O6n1axGbjIDrw2Fkt3myT0gCQGjOh8snMpqKxzXdFf34A2C/p+h1JwYd9EoZkq+Qzi yJHoBT+m7wlFWK0A/t21Pz8L0s2JlWqGKKzybVZN8A9xgN13wd4T0R1eY08v66Fan3 G4F2dfzLmrrWg== Date: Mon, 28 Jul 2025 14:21:01 +0000 To: =?utf-8?Q?Tim_D=C3=BCsterhus?= Cc: Nicolas Grekas , PHP internals Subject: Re: [PHP-DEV] [RFC] Warnings for PHP 8.5 Message-ID: <78wTLftfjxMKQgZQy7vwvAsU6uUF3j4QNdErydI2iTMqZQhv4lwAFUPoyOZHwFoZOeh4x-SOI958Smf9WVkNvX909jZII5rBWihwMU5Ljkg=@gpb.moe> In-Reply-To: <8ed8808afd83f8c8ff962f81878b059e@bastelstu.be> References: <8ed8808afd83f8c8ff962f81878b059e@bastelstu.be> Feedback-ID: 96993444:user:proton X-Pm-Message-ID: f7a34d897d5de832dc67626fdcf1a07c2f40829f 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 Wednesday, 23 July 2025 at 14:03, Tim D=C3=BCsterhus = wrote: > Hi >=20 > Am 2025-07-23 13:30, schrieb Nicolas Grekas: >=20 > > > About destructuring non-array values, null is a very common case that > > > allows writing nice readable code. > > > Here is a dummy example: > > > if ([$a, $b] =3D $array[$key] ?? null) { /.../ } > > >=20 > > > Turning this into a warning will have a significant impact for sure. > > > Even > > > a deprecation would just make the language a bit less pleasant to use > > > without any real benefit, unless I missed any other rationale. > > >=20 > > > If you want to provide default values, then surely: > > >=20 > > > if ([$a, $b] =3D $array[$key] ?? [null, null]) > > >=20 > > > makes more sense, especially as this allows you to choice different > > > defaults for $a and $b. > >=20 > > That's broken, the "if" will always be truthy using this style. > > There's nothing wrong with the current code. It doesn't need to be > > deprecated. >=20 >=20 > It seems appropriate to mention the previous (declined) =E2=80=9CDestruct= uring > Coalesce=E2=80=9D RFC at this point: > https://wiki.php.net/rfc/destructuring_coalesce. Perhaps it might make > sense to revisit that one? >=20 > Best regards > Tim D=C3=BCsterhus I've dropped warning null from the proposal, and mentioned the declined RFC= . Best regards, Gina P. Banyard