Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127595 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 A51BC1A00BC for ; Wed, 4 Jun 2025 16:47:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1749055518; bh=6f7h2MwSPTyWwMGa+rCHreUSy1A1HY5YzlwGOYnrIH4=; h=Date:From:To:In-Reply-To:References:Subject:From; b=QYPFElhenDdCCgb8uFauoJxKQFHFWNiljqk1u/KOTv1LmI88qf8gti/1c7X9b24K5 DcntAX4yGh/7JgvINbdlidNUkj4McyodvcsG3CeNKTzTbcD5aHGTCaLHqIMBPWYq4h gCgtSGFUaw6sK0TYSf6PRIkyAHvLY2fr7/iVoy9Kqtc4SPPe7eTDuhiB4SX2+M8PMn QwKMUFQbR1WU2W/gJ7GHMzO/awX6Yz9HMGsnVBttlKJaUo7wR6GzyJhJm4lM8ZGa0A Jo/9tKvp+yRFZ7xhJq3Uw3mQjmYC5zGUCvnrjf2JUgtw7FiX8lXh3QfFK03wihsNKV wa5Qhap7nDsGA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 308041801D5 for ; Wed, 4 Jun 2025 16:45:18 +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=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from fout-a6-smtp.messagingengine.com (fout-a6-smtp.messagingengine.com [103.168.172.149]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 4 Jun 2025 16:45:18 +0000 (UTC) Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfout.phl.internal (Postfix) with ESMTP id 740B113804AB for ; Wed, 4 Jun 2025 12:47:21 -0400 (EDT) Received: from phl-imap-02 ([10.202.2.81]) by phl-compute-10.internal (MEProxy); Wed, 04 Jun 2025 12:47:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; 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=fm1; t=1749055641; x=1749142041; bh=b84v0pYLSji1SVoLmCNFB ZXQZMzv4oJU1qfP0f11W9s=; b=k9zkM+4nkwuuzpIAs8c5CZa+HBmHkHid7Yr8u SxU7b3IxMt3pVuDA4zB92GvYV3RCHjqggmM+GAunoWx1/gRI05WPTjbUMJ0GH1xW AbG7bwb1KQ6V1QKgx/reJaORVYzLXDKEZbwwJ2OqI+e7QXvDswohm3d1IPdSxj/T vy7Mpexf3XF8wBakh1BKhwDlpM8p+Q4Au3kYmHSMH95yavIJRGM08q5qXe3ZhO+G 1VnqjLU/LqieMat2ZgFw3fwQbO65saSVcwmz32OmdKZzLUI2jsJl+jJALAgbLudQ yEJUpv1xiPpnGeJDEKFlhrD7xiY6+vWNyV8Bb8NDcyq4ZSPOQ== 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-sender :x-me-sender:x-sasl-enc; s=fm1; t=1749055641; x=1749142041; bh=b 84v0pYLSji1SVoLmCNFBZXQZMzv4oJU1qfP0f11W9s=; b=Jt8YkqS+9yzmg3xDn uFJ0VpKK8ukGFMlYrri+FpVijqmXYidWmgmJ5phAkGaRq7yQKCJfpQOv5nzWNx89 LvF/eHXDmExalHDpt9JeLye2YxPXDtel8Krr5rSWf46YHswDMfLviByizC/gCXhX cCjWbGxbsLhpBIqamXSlUeqNu1mK+iQsPLK7HqRMGEbV2Innw6cWzl7CeoCcPsFA dNzkJ3ml8U6J+NBluEmcmw+yTeN/ZaTtB4yRwG3Xv4vlZ67NuFC9YdxtI5ox3bC0 nQ1RGg4sWNDO8F4tejKeVosTw3zu10wBWRpQflEyA+FJgbuzoS0KkzeM/V7F6UNx dGV1A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddugddvgeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepofggfffhvffkjghfufgtgfesthejredtredttden ucfhrhhomhepfdfnrghrrhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfih gvlhguthgvtghhrdgtohhmqeenucggtffrrghtthgvrhhnpedugedvlefgueegheefjeet ffduveeltefhfeegjeffffelgedttdevkeegkedugfenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehlrghrrhihsehgrghrfhhivghlughtvggt hhdrtghomhdpnhgspghrtghpthhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpth htohepihhnthgvrhhnrghlsheslhhishhtshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 22A24700061; Wed, 4 Jun 2025 12:47:21 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 X-ThreadId: T8ad50b7ff47c9016 Date: Wed, 04 Jun 2025 11:46:58 -0500 To: "php internals" Message-ID: <01d26f97-9b22-475d-bcfb-a9fb13b406f2@app.fastmail.com> In-Reply-To: References: <3Yl0UGauXmKqk7s7Hqbv6iaXru-hZHf8Wj6VjwwihgRSaqZo5EZ2ndsOle-ae41C-lvnirynWt6PpuD7UJPL0zPCw18QHFE81Eb--fiiEbc=@gpb.moe> <0825f6bb-38c5-47c2-abff-2c1a07eddb96@alec.pl> <3149e465-d10b-40a2-a52a-4cdba738b438@alec.pl> Subject: Re: [PHP-DEV][RFC] Deprecate type juggling to and from bool type within the function type juggling context Content-Type: text/plain Content-Transfer-Encoding: 7bit From: larry@garfieldtech.com ("Larry Garfield") On Wed, Jun 4, 2025, at 11:16 AM, Theodore Brown wrote: > On Wed, June 4, 2025 at 09:37 Aleksander Machniak wrote: > >> On 4.06.2025 16:03, G. P. Banyard wrote: >>> I don't understand what you mean. >>> The purpose is to deprecate the behaviour in 8.5 so that it can be removed in PHP 9. >>> We try to not break behaviour with no prior warning. >>> Could you clarify what you mean? >> >> I meant to move the deprecation to PHP 9.0. I feel the impact of >> deprecation itself in this case might be significant. > > You feel there might be a lot of code passing floats, ints, or strings to > `bool` parameters? I'm doubtful this is the case, since static analysis tools > and IDEs are in much more widespread use nowadays. > > In my experience passing non-boolean values to a `bool` parameter almost always > indicates a bug, and it would be valuable to get a deprecation notice sooner > rather than later so these mistakes can be fixed. > > Regards, > Theodore The one place I can see it being used now legitimately is MySQL's TINYINT pseudo-bool columns. If you're mapping your query results into an object (please always do this), then you probably want to cast that into to a bool, and currently weak mode would let you do that implicitly. I can't think of a case where a string or float magically casting to a bool is reasonable. --Larry Garfield