Newsgroups: php.internals
Path: news.php.net
Xref: news.php.net php.internals:123680
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 4293A1A009C
	for <internals@lists.php.net>; Wed, 19 Jun 2024 15:35:22 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail;
	t=1718811395; bh=PQZT2jQbBPQ+lKvt9luFNqzRw8LT/rMF1pVcXjBfCvU=;
	h=In-Reply-To:References:Date:From:To:Subject:From;
	b=Wu9pECT6Kint3GwClFHV8lMf5tpOPAG9l4YYOKRAWDmgxnb2gTRnoyswKX1jH2jRs
	 HlIbv1kUcx2hf1Mb2IOjL5QfDM1JkGiVd85OQHI1mUpwfX4B2fvFi51Vyn0QFEyHqp
	 LtNZNhDO8oaFO9UXI3CS244K8+3wLcdJk1uSLMEYhdbgb0u/CFs91SHt1EyJXXg16+
	 USiLq2np0la+VqqVS6fxc9oO2J4EDGjW73lRz8T6WbFLveVk3Okq2DLQjf7tiKhWcf
	 u18+k2MLJEBM6MzWNQL9R+o0K+934SNISeUAiH0/jGe4Tqyfd8Dldvs3FeSi6pQJbr
	 Jp4E599hBmapg==
Received: from php-smtp4.php.net (localhost [127.0.0.1])
	by php-smtp4.php.net (Postfix) with ESMTP id 6F44A180871
	for <internals@lists.php.net>; Wed, 19 Jun 2024 15:36:34 +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,RCVD_IN_DNSWL_LOW,
	SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no
	autolearn_force=no version=4.0.0
X-Spam-Virus: Error (Cannot connect to unix socket
	'/var/run/clamav/clamd.ctl': connect: Connection refused)
X-Envelope-From: <larry@garfieldtech.com>
Received: from fhigh7-smtp.messagingengine.com (fhigh7-smtp.messagingengine.com [103.168.172.158])
	(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 <internals@lists.php.net>; Wed, 19 Jun 2024 15:36:34 +0000 (UTC)
Received: from compute1.internal (compute1.nyi.internal [10.202.2.41])
	by mailfhigh.nyi.internal (Postfix) with ESMTP id 9FDD311401FD
	for <internals@lists.php.net>; Wed, 19 Jun 2024 11:35:20 -0400 (EDT)
Received: from imap50 ([10.202.2.100])
  by compute1.internal (MEProxy); Wed, 19 Jun 2024 11:35:20 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	garfieldtech.com; h=cc: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=1718811320; x=
	1718897720; bh=DleSFgv2FjqCksQsCcJEOAhw/xq2rcPL6XuWNsfy7gc=; b=G
	A2BiCXCS8VjrqzirlZnl8YaMagkEyMYRLMSC/1ZnIhSb/3oRyasqyYgOO9sgQmXw
	l6z9rRm84WGNx0a4GOguAThniZxYwev0bPom2s/skWoKdcHf9a4MvbDUrTzgtslG
	ReogoupNwObfMzf68nyich8FUAxeTOuYGc7fnDXnUq/DlQH3gmB8bKm0vtjXs0BO
	B+6U48iPxpq+V1jUmp9+q+c8KbaCETjMx1p+Xuq6Rft8qpZDHnIZGnP+u84a8lU3
	05J8arZWyL88t0SRDrXC+MqQvuyC5FspZ3C073jLY1yWrSCqrMfgZArCrBjDZQU5
	UZOO9n01zK1Sq3s+9ut7Q==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=cc: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=1718811320; x=1718897720; bh=DleSFgv2FjqCksQsCcJEOAhw/xq2
	rcPL6XuWNsfy7gc=; b=MqEgiNYYqAsgQJ539psglMihM/FyYUXofrR9Vjia+e3O
	rQze5PANc9SQ4/2CSIEc2sQe/eZIr9UB3zE/Vzk/RhqJql8HsoiYbBrnDyjL/KaG
	r6a47ydFtj+xZRuH/XutMsMSqfSrlDeSTmwrE1gE/x0fOeggDUmdISq1vCj4Bgc1
	P5ZgReHtuMG9YzDvX/itW21ztWa410yQdT/q7imUKwCuJgySrfcVsRI2ICPEMUwi
	oJO2kLrHs2VDV4JnwgRVoROJZhQCqVVd7geCiOVRvdclQOMboJzBYpeWf7G5iNOW
	2i5pYCJZFF7uzpnxTkK94TMsFVL/QOO6WkjdRDrvVg==
X-ME-Sender: <xms:uPpyZmrHp1kvMCbc39O2y_QTl-lWbZz9ohlqnq1lo8Hr3IrENPb4ag>
    <xme:uPpyZkpAR_NrvCQbk8q8KYXLnnL6jiNuWQjYqLiGy-04vLjaB3PuTTtE7ATMawu6T
    -F16LFsQl_sqw>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfeeftddgkeekucetufdoteggodetrfdotf
    fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
    uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
    cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomhepfdfnrghr
    rhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtoh
    hmqeenucggtffrrghtthgvrhhnpeevffejfeevieegveeghfdutefhgfdttdefkeekkeev
    iefhkeeghfeuvdejheeukeenucffohhmrghinhepghhithhhuhgsrdgtohhmpdhgphgsrd
    hmohgvpdhphhhprdhnvghtpdgtohhnthgrihhnvghrqdhofhhfshgvthdqsggvhhgrvhhi
    ohhurhdrmhgupdgtohhmphgrrhhishhonhdqvghquhgrlhhithihqdhsvghmrghnthhitg
    hsrdhmugenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhm
    pehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomh
X-ME-Proxy: <xmx:uPpyZrMzsQA5h6caqbAcEyTcnqT86MS30Pom1jspqSprt_4rvqEAWg>
    <xmx:uPpyZl5BzafY0cWpwQrk7ww89qiZkS6im2GWk7ZTsc52UrS11rX3Gw>
    <xmx:uPpyZl4NC947y8-iGJfMPuMOJZ6CDgr28xB4AG10bAKUNtwcSGL0Og>
    <xmx:uPpyZljBRdAcuicwhryvZho3LoH6bdDk4eGaZTfrSWAc1PFSktIx4Q>
    <xmx:uPpyZmVyk01YfcTAzVTP8l75IAhNLDuHc6NmL3XzxckT67xT-OqecAYS>
Feedback-ID: i8414410d:Fastmail
Received: by mailuser.nyi.internal (Postfix, from userid 501)
	id 4318A1700093; Wed, 19 Jun 2024 11:35:20 -0400 (EDT)
X-Mailer: MessagingEngine.com Webmail Interface
User-Agent: Cyrus-JMAP/3.11.0-alpha0-522-ga39cca1d5-fm-20240610.002-ga39cca1d
Precedence: bulk
list-help: <mailto:internals+help@lists.php.net
list-unsubscribe: <mailto:internals+unsubscribe@lists.php.net>
list-post: <mailto:internals@lists.php.net>
List-Id: internals.lists.php.net
MIME-Version: 1.0
Message-ID: <673a1803-83c4-44b4-bd73-4ba61e83412e@app.fastmail.com>
In-Reply-To: 
 <9d28c9tOCChpWUcP1SFiFwtf2-w2XAtDzHsmM73myA7zfBsn7TxxEqs-VCnxRAgZjsk2TxS55owmM8wSLgBQL8LgeQLntUQ9toeLMkjTVx4=@gpb.moe>
References: 
 <CAPzBOBMidokE3xw251f+_qbCPAyQQRcN1WnyVF0xfuzaPBU3JA@mail.gmail.com>
 <9d28c9tOCChpWUcP1SFiFwtf2-w2XAtDzHsmM73myA7zfBsn7TxxEqs-VCnxRAgZjsk2TxS55owmM8wSLgBQL8LgeQLntUQ9toeLMkjTVx4=@gpb.moe>
Date: Wed, 19 Jun 2024 10:34:59 -0500
To: "php internals" <internals@lists.php.net>
Subject: Re: [PHP-DEV] Renaming "strict types" to "scalar type coercion"
Content-Type: text/plain
From: larry@garfieldtech.com ("Larry Garfield")

On Wed, Jun 19, 2024, at 10:07 AM, Gina P. Banyard wrote:
> On Tuesday, 18 June 2024 at 17:37, Robert Landers 
> <landers.robert@gmail.com> wrote:
>
>> Hello internals,
>> 
>> [...]
>> 
>> What are your thoughts?
>
> As self-proclaimed leading expert on PHP type juggling.
> That it is a terrible idea with no gains whatsoever.
> Renaming the declare statement does not improve the situation.
>
>> PS. Personally, I would rather unify non-strict and strict in some way
>> that makes sense ... so, that route sounds nice too.
>
> See my old meta RFC: https://github.com/Girgias/unify-typing-modes-rfc
>
> It is a somewhat known hot take from mine that I think the strict_type 
> declare statement was a mistake. [1]
> Mainly because it affects barely nothing in regard to the engine.
>
> I have written/co-authored multiple RFCs over the years to make the 
> default coercion mode less whack. [2][3][4][5][6][7]
> And my container/offset RFC is in the same vein [8] which lead me into 
> a different rabbit hole then the one I was expecting to explore which 
> is addressing PHP's weird comparison semantics. [9]
>
> Therefore, I would rather we focus on *actually* fixing PHP's 
> semantics, than arguing about changing the name of something that 
> shouldn't really exist in the first place.
>
>
> Best regards,
>
> Gina P. Banyard
>
>
> [1] Slide 68 of my PHP UK talk "PHP's Type System Dissected": 
> https://gpb.moe/doc/slides/PHP_Type_System_Talk_PHPUK2023.pdf
> [2] https://wiki.php.net/rfc/saner-numeric-strings
> [3] https://wiki.php.net/rfc/implicit-float-int-deprecate
> [4] https://wiki.php.net/rfc/saner-inc-dec-operators
> [5] https://wiki.php.net/rfc/locale_independent_float_to_string
> [6] https://wiki.php.net/rfc/exit-as-function
> [7] https://wiki.php.net/rfc/deprecate-boolean-string-coercion
> [8] 
> https://github.com/Girgias/php-rfcs/blob/master/container-offset-behaviour.md
> [9] 
> https://github.com/Girgias/php-rfcs/blob/master/comparison-equality-semantics.md

What Gina said.  Renaming the declare key would involve changing *literally millions* of files, even if it's over the course of a decade, for little if any benefit.

Reducing the delta between weak mode and strict mode to the point that it makes little difference (by making the PHP type juggling system less nonsensical and random) is a much more achievable goal, and actually has value to justify the effort (both for Internals and for people updating their code).

Also, as someone who does put every file into strict mode as a matter of course, and appreciates the many languages that do not even have a concept of non-strict mode (like Go or Rust), I really don't appreciate the backhanded comments in this thread about people who, you know, care about type safety.  (Something that weak mode, when it was introduced in PHP 7, only marginally provided if at all.)  Strict mode prevents bugs, full stop, and we should not fault anyone for applying that bug-stopper tool liberally.

--Larry Garfield