Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122721 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 7E31F1A009C for ; Fri, 22 Mar 2024 07:47:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1711093668; bh=321LHacDQmYPSX7kJjiPprxFfplbcTIAyTCK28XpR+o=; h=Date:From:To:Subject:In-Reply-To:References:From; b=U3XHuO8MAp0ipiWNljGzWJiuxPqWIVSGBXPUP4dWFCUBi18/QcLHQuJAbvJxXwAbL UvGInTqM8kIoNpTOAC8VpZRM55ipWemUIfnEkfeCoApbBuTeh1o7ZrZvnkPgkEmcHM DRwOzcB6OE3PTREfmsbsgl1QTtiwQqTC6LygOLu2bglNQnDtDHuOZqMQEkO4IQuNry 5IAYRBXi9u1Gcm9VH3b7em4iCtz85z9geYKHuIuOCjLYjc4A5Y//MBr22DzifUzG6G gObPCEHLXMdxpRw/rewc3TPs8onxwVz8doS597zOn6JSMjEnKJWxJdC6hSPBkOTmZ/ So/a941JpNUIQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B31ED18069A for ; Fri, 22 Mar 2024 07:47:46 +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.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,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 fout3-smtp.messagingengine.com (fout3-smtp.messagingengine.com [103.168.172.146]) (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, 22 Mar 2024 07:47:45 +0000 (UTC) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfout.nyi.internal (Postfix) with ESMTP id CA2DC1380053 for ; Fri, 22 Mar 2024 03:47:22 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Fri, 22 Mar 2024 03:47:22 -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=1711093642; x=1711180042; bh=321LHacDQmYPSX7kJjiPprxFfplbcTIAyTCK28XpR+o=; b= X0zwscRWZeM/fccgxAdRC/ALFkYPb7OUe1yLAN7AGizoZP7AhXQ8iUUIynbKueqA uwkfvMmadzSei0RTJ7NbCbm9IRNYuUqlcyDPkD+Lwft+vwWHlhv6QT6GqR+DfRX+ 7N4rpiVZNIu72ccnF4Y2qTBwTG1A4Y2f8REiOLKW5PUVVy6peSUrraXFPshKmMn3 nklpq5rFaT9STK7wzGLeCfsIFAMmx8snr9EJ6+a56iZEQkP2lg3vSlHc2BiAvP3e xInosMJ3d2MhpkwPaFhTSR7Gp53MI1FCDWHYKV7Js3ZR2ZMbapULhRMTdTdx9C0I FUwAfJY2sYdAsN1XtlDK/g== 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=1711093642; x= 1711180042; bh=321LHacDQmYPSX7kJjiPprxFfplbcTIAyTCK28XpR+o=; b=E dNyeYIm5teyqWeswIdSpMQGWx8X83W65gChPz9unTYdhgfu4PZsm0aOgqB+1wm5z gnij1/smWRBECnqHnYSdsWBGSs/PiYspqT7vfMIOS0lIwz6Cf8x7PFgWTTwgwmHE Nx3X3v+V8DGD542tut7GtyDiu+bgKlkTCSyjRh6jK/Yhd3UG8ohANem2FW8y8coY Y3Mf+WUmLuoN5sDXnT1Xb23Rg9e57Ohs19SBquaGa518zX7pUlsYQsQ3STmtnTUR 1O0UBp+OTPKKuITGvXXPLWxbdLrkNYrVc3IWLcjTP73smCZScZevGdSeCGN0NpZD 9MhQcS8ch+xw4X8FA7pwQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrleelgdektdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffufggjfhfkgggtgfesthhqmh dttderjeenucfhrhhomhepfdftohifrghnucfvohhmmhhinhhsucglkffoufhorfgnfdcu oehimhhsohhprdhphhhpsehrfigvtgdrtghordhukheqnecuggftrfgrthhtvghrnhephe elffetiefgveduteefudegtdduveeludegueegleehiefhhefgtdekveevgfelnecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepihhmshhophdrph hhphesrhifvggtrdgtohdruhhk X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Fri, 22 Mar 2024 03:47:21 -0400 (EDT) Date: Fri, 22 Mar 2024 07:47:20 +0000 To: internals@lists.php.net Subject: Re: [PHP-DEV] Proposal: AS assertions User-Agent: K-9 Mail for Android In-Reply-To: References: <3F78A125-1946-42E2-A4F5-A2B282BE2107@rwec.co.uk> <2d7ec203-6e80-445c-94f4-d29ef58743b1@rwec.co.uk> <40d5c22f-5c06-403d-afc2-84c202277a29@rwec.co.uk> Message-ID: Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") On 22 March 2024 00:04:27 GMT, Robert Landers wrote: >I think that is where we are getting confused: `null` is a value (or >at least, the absence of a value)=2E The fact that the type system >allows it to be used as though its a type (along with true and false) >is interesting, but I think it is confusing the conversation=2E Every value needs to belong to some type: for instance, true and false bel= ong to the type "boolean", as returned by the gettype() function=2E There i= s a value called null, and the type it belongs to is also called "null"=2E= =20 Unlike some languages, PHP has no concept of a typed null reference - you = can't have "a null DateTime"; you can only have the one universal null, of = type null=2E The existence of "null" in type checks is therefore necessary if you want = to allow every value to pass some type check=2E There isn't any other type = that can include the value null because the type of null is always null=2E That's completely different from true and false, both of which are covered= by a type check for "bool"=2E They are special cases, which aren't consist= ent with anything else in the type system=2E The "false" check was added fi= rst, as a way to express clearly the common pattern in old standard library= functions of returning false on error=2E Then "true" was added later, for = consistency=2E Both are newer, and far more exotic, than "null"=2E Disallowing true and false in some type checking contexts would be fine (a= lthough mostly they're pointless, rather than harmful)=2E Disallowing or re= purposing null would mean you have an incomplete type system, because there= is no other type to match a null value against=2E Regards, Rowan Tommins [IMSoP]