Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:128055 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 DDCA71A00BC for ; Tue, 15 Jul 2025 17:16:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1752599704; bh=irv9tEbnfESeriy+UUJGLVluZ+u7XciK1+BCMHUR86A=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=fKE06BjKZp/0dfysMKmFSj6zUDFpondgPK6GVNctt13yA7X3KzR9uLGojEICecHGj 9t8hixOrSRM4VcHqHWy6ZssomK66Y9HEewRcdZWPSABR59K20LxdEyuEPDJm75r9nY wgU7FlJIulIuPyLQNA+cpKI/4RKRU2wSGedUVEIAmosutM1r+tRTe6TKnWpbu4kc3H KHNI8cvgWs4+pGSWXDm9/0o0vs3mddFVyoKrgl6zGK1RpMCoXa9HhZxY8l2DVtEIRy mQHlFLw57pF1qSizpKbMt9we/haytQJeNPCd+LbC6KQ6vkSYYfnH/xMgmpuE4pREo8 9UmuXIQferqpA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 262D3180531 for ; Tue, 15 Jul 2025 17:15:04 +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=-1.2 required=5.0 tests=BAYES_40,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, 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-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) (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, 15 Jul 2025 17:15:03 +0000 (UTC) Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-55516abe02cso109249e87.0 for ; Tue, 15 Jul 2025 10:16:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752599810; x=1753204610; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=irv9tEbnfESeriy+UUJGLVluZ+u7XciK1+BCMHUR86A=; b=OUOMLapRntmi+b+rJkW4S/HOzN2cirMnCmg57bDpEmSP0AY7CeWUS/9aCJq5eMPvEI rNJucmHzlVxgXBiMoxUd3NWCKKI9+a9Nftap3zNejezf+TZtxTk2CGovaXBXX/sxCQ4b LbAsUSIAiDO80YXd+7SUBLwg+nLZS/DpxunnF6rQEg+HjE3otcsv4P8ZTbJDvBRqWEBz CPa5Y5sNagZLeP+nUxxfvvPS1IWiCRb2+k7QCQTRN1CLF266N05ftnHv8spkqRc0U3iZ 2SSm71SCgTjbrkJzT/lHs70GSHvrhR4rh+nNgDLuU+vynLkfbFvgP3ZdzDtlOY3fPP3E iZ7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752599810; x=1753204610; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=irv9tEbnfESeriy+UUJGLVluZ+u7XciK1+BCMHUR86A=; b=etAudatED7pkv7vTfTQvWs6cuexBh1QzaP7Df+TyRAId7p5nzp7ZPzWyu/asUO9BeY Jk5/6/kRt3XsCt1ZYp33TDz+ov354+36QCG/Rn58bqH9pp+vM7cCjcvp3hR0ZlbWZ68k a+YmCmjjTb9vAKdW0UB7xz3oW9Uod1yjln1ybXbPuItuLzDpAFxaXzVuFyCGaGCvvlv9 u77lPWKifGiR3QTi7pjM889gBkghpomv4yl4zsOnAcIUnqlVJcY4LFf2yp3lKxXduK52 fb/K4zLgBYblBTbD/t1PnEeprXSaxoglBRQ2BYXjq3798CU+uEeAaTi9gNt+TUN9xqlR 2aRw== X-Gm-Message-State: AOJu0Yxz4YY3TdclPWVCshm+aic8MSo0f6wApn6kXOvvWSsUyWFpZ2mR MNZvKavHGJGHxeehEPujyD10dcyJxxJIockM5EWLJNPVbXcAdpbTME3Lz/Zs8YrpU31lvfT7S6O TT9YK9Tl/Un4zJ1BV+cJTGrgBN8vCX2P1MPmU X-Gm-Gg: ASbGncuvsRPh5m88Jl/Y7T1/l4RtQeyOYbelSOWS8t0NhkXF+t0iWAaQ8Q0Db4cOix1 WodVDrMR6HxveoPSpUshoQcXLnzjNWzgS96QH1cVzyRS2t51R/srQesuUk+ft9Y6QkEQuo9+ZyA oYCadfebcY4gAxNlZ1XtLOoTFdkc7NvO0lCqfdnP7wYoVhSQOMsazopx13qrCydsRBI7zpm/fyO SmZRUyjLj1GvwQ= X-Google-Smtp-Source: AGHT+IFrahkwwOTBrzkJDXEMwhzk+GPDdtBMF3+rgxEWeT4/Bc23x9Se1tnJ/FfgmgZ2fLj8NFQpEA15z3OoSzzDddM= X-Received: by 2002:a05:6512:32ca:b0:558:f7fc:87de with SMTP id 2adb3069b0e04-55a1c47a038mr1716653e87.24.1752599809824; Tue, 15 Jul 2025 10:16:49 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 15 Jul 2025 19:16:37 +0200 X-Gm-Features: Ac12FXwpPeJhMlVA0BBbASPS7xmB0-Mq10DpBiLA1LnA5A_YC39e5yUvPPYhYBs Message-ID: Subject: Re: [PHP-DEV] [RFC] Warnings for PHP 8.5 To: "Gina P. Banyard" Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000191e460639faf119" From: nicolas.grekas+php@gmail.com (Nicolas Grekas) --000000000000191e460639faf119 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Gina, Le lun. 14 juil. 2025 =C3=A0 18:22, Gina P. Banyard a = =C3=A9crit : > Hello internals, > > Similar to the mass deprecation RFC, I would like to propose the addition > of a few warnings in certain situations: > https://wiki.php.net/rfc/warnings-php-8-5 > > I am expecting these 4 sub-proposals to be mostly uncontroversial, > other than possibly, the "Using offsets on non-container values in > isset()/empty()" one. > > As this is intended to land in PHP 8.5 the discussion will last 2 weeks > and voting will commence on Monday the 28th of July 2025. Why warnings and not deprecations if the plan is to Error on PHP 9? As you might know, it's very common to turn warnings into exceptions in userland so this will break apps for sure. Deprecations don't if properly handled. Please trigger deprecations instead. 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) { /*...*/ } 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. The rest makes sense to me, thanks for spotting these cases. Nicolas --000000000000191e460639faf119 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Gina,

Le=C2=A0lun= . 14 juil. 2025 =C3=A0=C2=A018:22, Gina P. Banyard <internals@gpb.moe>= ; a =C3=A9crit=C2=A0:
Hello internals,

Similar to the mass deprecation RFC, I would like to propose the addition o= f a few warnings in certain situations:
https://wiki.php.net/rfc/warnings-php-8-5

I am expecting these 4 sub-proposals to be mostly uncontroversial,
other than possibly, the "Using offsets on non-container values in iss= et()/empty()" one.

As this is intended to land in PHP 8.5 the discussion will last 2 weeks and= voting will commence on Monday the 28th of July 2025.
Why warnings and not deprecations if the plan is to Error on PH= P 9?
As you might know, it's very common to turn warnings int= o exceptions in userland so this will break apps for sure. Deprecations don= 't if properly handled. Please trigger deprecations instead.
=
About destructuring non-array values, null is a very common = case that allows writing nice readable code.
Here is a dummy exam= ple:
if ([$a, $b] =3D $array[$key] ?? null) { /*...*/ }

Turning this into a warning will have a significant impact = for sure. Even a deprecation would just make the language a bit less pleasa= nt to use without any real benefit, unless I missed any other rationale.

The rest makes sense to me, thanks for spotting thes= e cases.

Nicolas
--000000000000191e460639faf119--