Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129016 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 E5A561A00BC for ; Fri, 31 Oct 2025 09:05:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1761901554; bh=iFxniwByZc6xzokCme1o49BKp978TFh10U3iSrgn3lE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=bOrRzymLOfpzr+rJPs4xNwmEzNtq8ZCnCSDFfkQfUDv0StOgHmpZgy9VzzxSmHNDI 30pSHz38xoICVHt5tQMJXrPbfVYkLbjiMCHfJnQTelMZEbbthY2UTFR8tJjkvwdKwM i503q/tX8oMRzl9kowX2J8cxwgrtgxKdNxaG1dDjx1cH+8TMiQA8Wgk7cGbeUJy/Y5 lZURsa3daSTS2F4xutqD7ooxLNL3sr7oWu1riUySpxXTk3brsixzh3E/c1GHFTVoho Q+cMydUu+Mfyg3fhgxpJqQDk9gGYigJUtAKa53ZW5jSdScbUjK4O5ro1itXBLAYSN4 8OS80fwY3pp4A== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id AEA56180041 for ; Fri, 31 Oct 2025 09:05:53 +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.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, 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: No X-Envelope-From: Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) (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 ; Fri, 31 Oct 2025 09:05:53 +0000 (UTC) Received: by mail-ed1-f42.google.com with SMTP id 4fb4d7f45d1cf-63c21467e5bso4230799a12.0 for ; Fri, 31 Oct 2025 02:05:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761901547; x=1762506347; darn=lists.php.net; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=iFxniwByZc6xzokCme1o49BKp978TFh10U3iSrgn3lE=; b=M1EYw2jvbsM1+xoNiwlSqKw4A0aaw42YGdm6VdOU46k//zVax/s3guooL+utRviVGo row682zT0JuKLKlIF2jzXOXejgc6eeDcUx7ZwQoj2jFCRs4f5xk6WurplcvvrIDnIPpU M8MEoa+NvYPeQ6LIjQasuze1dLYuPqoX5OH2jlrpOP5eYXYTRlSEvqktwNH0NLpIoxv4 DCNMfgG8bOFumNYtsCMh/BVzxWjmIsfYN8tVNw/ThLz299bXZpHhlsrwIpJxzdNu4KRP fBTV0ppIYbMFUldKWq250dT+ew+ei6iyoY1ZICllT27x88ogz9eFH9fgpwkvDqih9Ovx E7xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761901547; x=1762506347; h=content-transfer-encoding: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=iFxniwByZc6xzokCme1o49BKp978TFh10U3iSrgn3lE=; b=dw5SC6fE6Sar18BNoHedWIVjR2vFaPYLEYl+u7OIerl/XvH3/vo2YWfzpw+XfnDywR vqodqRIo7M9lBq6iUhUalN/3lk6y16kLFwhoumy12n3Ve/zCKFg3t+trQXFGgWwQGNLb x0UNn1hr8C4FJrbvSXiqhxAU7yH1QeJED2r1SpB4r2vucCo9spp2OgZnIiJ1VnokUgsD US01Zl0uxY/Cgf9seXZg0PmNpNYJdKU3gsWmXN5JoMHcQmGCFs87KHA+/lMuqsHBCbxC g+CRID+LCh6NTACshLC4Bl7QELgHxWaaIBq5qffeKyZaldG3KLjDmoFnSlRzFtwID9/H vVhg== X-Gm-Message-State: AOJu0YwBXMkybp7rTl+O5nDuzQ9Zji1gH3QfGHOHZOBHPjo4X6ER/8Ai UE+TWei+YrRWd1DfM7WiY67PVoEJrqHmXz169LAScH8Y5e3idAl3IvaEkSnGPl6g3IXvtM+dZlx AvYTY/2PL9lRMtrBji1oxhMwCvOsCMe3l9z32 X-Gm-Gg: ASbGncvbI2S6/RslZOq//r+Z+3TjPuGprtwjgLtZNYM9IIvdmLhBhKmuVmMmrIsNVMV wXxHfdRoKb0SOjm+k8ZNbuWq5EnMS+HNPyOyee0nM7/Kma1EpkrkM6/niR9x6gGRlGbaAKHk5Nj JXNXDvMJ/D1C71lcfhPuJumgat2Q1pcy9OrRsuKpcrXmlxG3zuFpKAa2mSU09z+FXmMtWkXvCI3 tQBKHHJmAmgrjWWwBecRBXipNCiiQ5GgJWd/Kc7gDW3zCUfVEuBQYts+qqKjkz9MwuTCuQw7acQ 2+w= X-Google-Smtp-Source: AGHT+IE2WK482jlf8NOg5zYByQpS5nFA7fZ9e8XsntXYXS23zN9oFZaOUhzwSUMWFwaIHzJfC5dJSJQlkeCaJv5yVhU= X-Received: by 2002:a05:6402:518b:b0:639:dd3f:f265 with SMTP id 4fb4d7f45d1cf-640771ceb67mr2252331a12.25.1761901546839; Fri, 31 Oct 2025 02:05:46 -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: Fri, 31 Oct 2025 10:05:35 +0100 X-Gm-Features: AWmQ_bnLiG5fHNnJjXfSV0lOvIvS1rPKKlAALz9UID95kYoNLATmmC47vtWTlP8 Message-ID: Subject: Re: [PHP-DEV] [RFC] Nullable and non-nullable cast operators To: HwapX Cc: internals@lists.php.net Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable From: alex.daubois+php@gmail.com (Alexandre Daubois) Hi, > Why not create a separate RFC to deprecate and remove(9.0) this and other= s strange cast behaviors. > > Then after it finishes decide how to processed with this one? We did some research with Nicolas about deprecating casting null instead of proposing a new `(!type)` operator. The idea did not make it, and we explained why in this new section: https://wiki.php.net/rfc/nullable-not-nullable-cast-operator#alternative_co= nsidereddeprecating_null_casting As for other strange (or "fuzzy") cast behaviors, we agree the current situation is not ideal. It is inconsistent with the rules of typed function parameters. We added the "Future scope" section to the RFC in this regard: https://wiki.php.net/rfc/nullable-not-nullable-cast-operator#f= uture_scope. This is something we will investigate in the near future. This is fortunately not a blocker to this RFC, as this would address an orthogonal problem. As you said, we have plenty of time before 8.6! =E2=80=94 Alexandre Daubois