Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:128978 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 56F7B1A00BC for ; Mon, 27 Oct 2025 15:21:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1761578479; bh=5S8O3C1Z7G+BUFYlPZzmyMWWfCaRGgb0HCEzqe8/8Ok=; h=References:In-Reply-To:From:Date:Subject:To:From; b=aAcbNA4qwAXjTKPZvzQFX3we0bEIEm5mC4Lmad87mWsM32mGKeox+zAHRpWPm77XR esL0khPEo5uOSO/O7XotlWzFymEI1iV9+I2LCLL54pdxdnFmgA+yzeBPiV9+XbjVxY l5D+lwk/HiUVy5v7pqu6+b+WD1Yo5NIyAfEj8TtmiXIVKMP2O/9X7IbDqJ0lcF8kg1 32mJ+8noky1Tg5rR+CuPY+4gCUL9Mhkw03ogdS+GBqeDP+2cgeWGH9eABP61pzKUCW t30wE7HgdRSKQ9Ne41nt6ScPjwtqlQI07KFY9+8hOb17b2vf6JhAqugG7ZF7qGFOOR tuQrWdPNdsFtA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E7B98180087 for ; Mon, 27 Oct 2025 15:21:15 +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.2 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,T_SPF_TEMPERROR autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-qt1-f195.google.com (mail-qt1-f195.google.com [209.85.160.195]) (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, 27 Oct 2025 15:21:12 +0000 (UTC) Received: by mail-qt1-f195.google.com with SMTP id d75a77b69052e-4e89c433c00so52496221cf.1 for ; Mon, 27 Oct 2025 08:21:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761578467; x=1762183267; darn=lists.php.net; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=dt8Uephu1MFo/HNzsYWqq6doo7KKY5OZ8bjFO9xtlYA=; b=dVXLwAfVrSxTYslgK8LBMK7xRPTLRn7j8s7+ae8BO5nD9/mMxekxc/+Ah/nxFfR+Fr EXkcaYffs+xXWyLiA927PgiuMh0dOoJCwFOPztRaoozBJB0ToCVtQKekQ3XeB8e5as7I 78P3Ylttjc2Ww1kChTUhGZc9kLnqKLui8TnzkLbBZVVO2SOEaTwxc4otW3lAc3TNebm2 lPfouWje5JnqtOKX6OTIbNUo7Lq6Q/bquLWPY5JLx5e7n+X7hfYWypJkq1v9RDu62S7Y Us8TatK3RSUosnY8llUfeMRw7zzuIG2v0LfWh241yz6yZu72T1XiTadtS5CGt5HrVsWo Rsbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761578467; x=1762183267; h=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=dt8Uephu1MFo/HNzsYWqq6doo7KKY5OZ8bjFO9xtlYA=; b=HTMPRqhRb8+elHaWzR9XRvTMIA52Kn9wNSFw3L1GxA7pPcXGesWqoLMIZ1gIy/81HG Wj3p6L7VzNQVQS3+cT69fv36NJsL9SsKaXjbzq7T3zDQMjhyIUaz7azj9g76agiebiUY 63PtbXMX6saS3RcwtO8aEY//H3Mw60DNxQN1cN7GnBwnrzvBu1mQiGR0PFx7RBrRonv8 Gc9SNaRjrFO58NYf5UcLy5BKtoPFE2Qs+wTXM3/bGkDdSJAC25HmUwdY7qdbPdoLfifh X++bkadyGwk/MzcSXbod/wW8jKus7LZreRpM82rlgGp2JBtGdODzSWr11kCsgkFLXZTk 4DtA== X-Gm-Message-State: AOJu0YyBkQ5wQoXIE/OH2jL14Lt2PswoC+5X2XgHGFD+CsdK4PhFcSHV n4dfJfKiIvL+dWjcL3eUpFJjEXh1w1oN00uknzCdVL0ci/mdLrhOVR1NoXMBPvYPIDqVHkRVQBG 99xUtblSujRdKYFGfMNwcF4bSNCgSxS1sMAjS X-Gm-Gg: ASbGncv2WDQt9Y4r0tJUWHS5eLF/ESKkJo7GXiR/R9B7HZ5Ttgj5iovRODSIomKuooX Xr3sim5Ba+ds7Qq+qrGkl3+bA4fMRORI8hl0GnHQj+p9laxC/F1+RUeATCCTxTBYTSQHM28kvMt +Gnc5JFCF6bxX87eadajOqlxXZ1Lz2ZzSc6mEXrAQsiI8cxrGUVDubbix4ahfN7V/J+xhKulP2D AKHjHZICBju9nye3ZYWaFMswvMFd8bSoSglwprPpWCW1qaJOYivRkPkBkPAo/ubmoD3I/IBck0s h86rqQR0MUmRw3KlQ30XhbBfC/M= X-Google-Smtp-Source: AGHT+IHo1JGZt9Pq6xw7Jg0I0g4O9yJeDwvkgLCaISWw4igvO4AJhftVbtszy8v66z83JEWcWp1v3wGLNOSPZLXLo20= X-Received: by 2002:ac8:7f84:0:b0:4ec:f654:8522 with SMTP id d75a77b69052e-4ed075bdff2mr5695001cf.38.1761578466784; Mon, 27 Oct 2025 08:21:06 -0700 (PDT) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 27 Oct 2025 12:20:53 -0300 X-Gm-Features: AWmQ_bl_NNoXnNQPJhS8tW3l7ZLrHsYkOJRY8pDV3xLh_oZxhXiU0FzIkgK5yek Message-ID: Subject: [PHP-DEV] [RFC] Nullable and non-nullable cast operators To: internals@lists.php.net Content-Type: multipart/alternative; boundary="000000000000c1b9330642257263" From: hwapx.dev@gmail.com (HwapX) --000000000000c1b9330642257263 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Oct 27, 2025, 09:55 Rowan Tommins [IMSoP] wrote: > Hi Alexandre, > > On 27/10/2025 08:03, Alexandre Daubois wrote: > > Thank you for your interest! I get your concerns about the extension > of such syntax, but we don't feel that there would be a particular > need of extending this syntax. The syntax does not bring something > really new: the behavior described in the RFC already exists in PHP =E2= =80=94 > we are just making it available at the cast level with explicit null > handling. > > > I definitely agree that reusing the behaviour from the existing scalar > parameter/return checks makes a lot of sense. I also agree that allowing > nullable types as the target of the cast is a useful feature. > > What I'm not convinced by is that those two features should be combined > into one: > > $foo =3D '123abc'; > Why not create a separate RFC to deprecate and remove(9.0) this and others strange cast behaviors. Then after it finishes decide how to processed with this one? There no need to rush, php 8.6 will be released only next year --000000000000c1b9330642257263 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, Oct 27, 2025, 09:55 Rowan Tommin= s [IMSoP] <imsop.php@rwec.co.uk<= /a>> wrote:
=20 =20 =20
Hi Alexandre,

On 27/10/2025 08:03, Alexandre Daubois wrote:
Thank you for your interest! I get your concerns about the exten=
sion
of such syntax, but we don't feel that there would be a particular
need of extending this syntax. The syntax does not bring something
really new: the behavior described in the RFC already exists in PHP =E2=80=
=94
we are just making it available at the cast level with explicit null
handling.


I definitely agree that reusing the behaviour from the existing scalar parameter/return checks makes a lot of sense. I also agree that allowing nullable types as the target of the cast is a useful feature.=C2=A0

What I'm not convinced by is that those two features should be combined into one:

$foo =3D '123abc';

Why not create a separate RFC to deprecate= and remove(9.0) this and others strange cast behaviors.

Then after it finishes decide how to proce= ssed with this one?=C2=A0

There no need to rush, php 8.6 will be released only next year
--000000000000c1b9330642257263--