Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122701 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 qa.php.net (Postfix) with ESMTPS id C60181AD8F6 for ; Wed, 20 Mar 2024 19:30:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1710963045; bh=LmdJF4B2r+BE5rd+B/nskMBj7sECeyCBj8Ni49b7heA=; h=Date:From:To:Subject:In-Reply-To:References:From; b=XqBdwOo98+Zi8ZBxi9OnqvAje/sPaxmOsJ1KKbtNbJousObV5UCe2CEurmUY3Qg2Y 8IKn7LPY/aN6x82haihfb8d0HnmLSfDwmLx2oT7FpL5X+i4a6GHEwtOKDtDht1zYPS SxvboKWI4GPlaK1J4u7CRY+MKMD9PgbydiMz5AlZKmU6N2Air4jEqLqALGbfBIWYsl QyIIGdQEverfFRDwiQER4P0/TO742XeVIYwLyHt+UJQtLj/J6F4ECqwiEBkrg1VyYH pM5EhWOxajC+MtveTIU57P2h0X1r1phPBlomEhfKJ2D5rINtbQJaKMqgtEnOB3OlGr 4I77dlVYbjZbg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3A91F180069 for ; Wed, 20 Mar 2024 19:30:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,HTML_MESSAGE, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from fout5-smtp.messagingengine.com (fout5-smtp.messagingengine.com [103.168.172.148]) (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, 20 Mar 2024 19:30:43 +0000 (UTC) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfout.nyi.internal (Postfix) with ESMTP id DE946138013A; Wed, 20 Mar 2024 15:30:21 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 20 Mar 2024 15:30:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rwec.co.uk; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1710963021; x=1711049421; bh=LmdJF4B2r+BE5rd+B/nskMBj7sECeyCBj8Ni49b7heA=; b= YGG3hn/F5NnstbjJ8A6xDO63WbD9ujJbDlqD2n/DK5EOhylsvKrnyP7ldIzxCtKd kFB9rKlkz/shWIehTX9xm7MzwoNo7QfwZD/R4xxXpbvWOqu5WW9C6HBQIsPq3r8e ergDvMIK0Y8t3Yo4xmJWQjkktnHTpstjA5+nKch53byx5CkAPjY1wGTNWB/PxiRG Rmfx4YszPXQQqq8X0PlKDdTy+6U0k4e/Jf055V5XKUbQ1kCzEKtbV6aSlo4iX8oh Y3GLeKcVSAqkZ8VKGJT5kV36yaIfpO7LINX2omF80wCkZX7eJBOJlLY8QbwZQuhp Us5f6AIwDnbqKV6SJAUlEA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1710963021; x= 1711049421; bh=LmdJF4B2r+BE5rd+B/nskMBj7sECeyCBj8Ni49b7heA=; b=h LXNUtUSGEasSKLlwR7ODjw2JaXJg9Mc/egHIMEEfcL86LGGxCj0gBVbTKOnc1vC9 TSM7w0ouz1bnFRC/J/yzD5MoBHaPWgVkWCEVWNc4SaXNPNbveR9Oeqmu1Cg5aoAh sXd/BdKUc58pR37plz0dE+suhe8AG2kzrNVjO23TKHAZoTtrBDXIMAA5yIomhdJ4 hFiv9P/SYEwWj7aThkWGZKuimkTJz5PphBpgeCw4QcD+q6U6HWZPjhdtuOa2DpOu ToE1mbZngV5EWLSqFz3iCe4/diU+Vifvy38PFMi7bn45bnEtJxatDAeVaevCHt9v N0TRGEgG3jMNUsXMvDJDA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrleeggdduvdehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffufggjfhfkgggtgfesrgejmhertderjeenucfhrhhomhepfdftohif rghnucfvohhmmhhinhhsucglkffoufhorfgnfdcuoehimhhsohhprdhphhhpsehrfigvtg drtghordhukheqnecuggftrfgrthhtvghrnhepueffffevffefhefgleegtdevgfdvgfeh teejtdehvdevgeejjeduudeiueehfefhnecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomhepihhmshhophdrphhhphesrhifvggtrdgtohdruhhk X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 20 Mar 2024 15:30:20 -0400 (EDT) Date: Wed, 20 Mar 2024 19:30:18 +0000 To: internals@lists.php.net, Robert Landers Subject: Re: [PHP-DEV] Proposal: AS assertions User-Agent: K-9 Mail for Android In-Reply-To: References: Message-ID: <3F78A125-1946-42E2-A4F5-A2B282BE2107@rwec.co.uk> Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Content-Type: multipart/alternative; boundary=----643D0XMZCHIE9CSBDO03GTBC6TPVDS Content-Transfer-Encoding: 7bit From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") ------643D0XMZCHIE9CSBDO03GTBC6TPVDS Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 20 March 2024 12:51:15 GMT, Robert Landers wrote: >Oh and there isn't any difference between: > >$x as ?Type > >or > >$x as Type|null I'm not sure if I've misunderstood your example, or you've misunderstood m= ine=2E I'm saying that this should be an error, because the value is neither an i= nstance of Foo nor null: $a =3D 42; $b =3D $a as Foo|null; Your earlier example implies that would make $b equal null, which feels wr= ong to me, because it means it wouldn't match this: $a =3D 42; $b =3D $a as Foo|Bar; If we want a short-hand for "set to null on error" that should be separate= from the syntax for a nullable type=2E Regards, Rowan Tommins [IMSoP] ------643D0XMZCHIE9CSBDO03GTBC6TPVDS Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable


On 20 March 2024 12:51= :15 GMT, Robert Landers <landers=2Erobert@gmail=2Ecom> wrote:

= >Oh and there isn't any difference between:
>
>$x as ?Type>
>or
>
>$x as Type|null


I'm not sure if = I've misunderstood your example, or you've misunderstood mine=2E

I'm= saying that this should be an error, because the value is neither an insta= nce of Foo nor null:

$a =3D 42;
$b =3D $a as Foo|null;

You= r earlier example implies that would make $b equal null, which feels wrong = to me, because it means it wouldn't match this:

$a =3D 42;
$b =3D= $a as Foo|Bar;

If we want a short-hand for "set to null on error" t= hat should be separate from the syntax for a nullable type=2E


Re= gards,
Rowan Tommins
[IMSoP]
------643D0XMZCHIE9CSBDO03GTBC6TPVDS--