Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127832 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 1B7E31A00BC for ; Wed, 2 Jul 2025 12:39:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1751459858; bh=U79baqXZrcM73Lw07pulPbL8af/w2eTytr/5FrhL0IE=; h=From:Subject:Date:References:To:In-Reply-To:From; b=QCudboFB9tgykhxzfGH4E2fUdEjlvE1SD98Vaiw6ZINQZkNVaHta1jMWkLA2abKQ+ LEq2kNgyV1IYNh0DHw8tCXLsROnBNaOw5uMISmpTlBYnn6jFYWBw/bIXWpMfMWnGZq b1x4vDXstE73LlxRfg5Nzu4u6+YQ2ottpjq0GG3UtBkUBC6bzV/YG1/8+Nbt1oYWAH Oa8ziV55AbPcvutdWz17HZ2uZ+AnGD0YmTW/7CYKy8mBHAijHj74bau7+qWv64jeCn LNRn8elk5MM0bZvSw3JWElhs7QW2w1VRHj31iwkgt7917WnlKMh6JCT0KfwKikg6Ds Grg/LjVE7YL7w== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B1D4C18006C for ; Wed, 2 Jul 2025 12:37:35 +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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE, SPF_PASS 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 mail.gna.ch (mail.gna.ch [212.45.196.109]) (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, 2 Jul 2025 12:37:34 +0000 (UTC) Received: from smtpclient.apple (unknown [194.169.219.181]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by darkcity.gna.ch (Postfix) with ESMTPSA id 9011B3A0CF4 for ; Wed, 02 Jul 2025 14:39:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cschneid.com; s=default; t=1751459965; bh=U79baqXZrcM73Lw07pulPbL8af/w2eTytr/5FrhL0IE=; h=From:Subject:Date:References:To:In-Reply-To; b=Z7km8kTIOaSxTcRbso2nSryDGz42NwXNJO0UGtHb2/EoavW1TnVARGJOwKJvuKcgl /2nZgjCF507NThDFv9uNk+t19ewOa5sjaXe60lNNXzMktTBJ9G/s2Aq5XKK9XAoxZs jF5UEU6ONgKydr8NTwRnUsR8NVdFEiwMqyJ+SZ4o= Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.600.51.1.1\)) Subject: Re: [PHP-DEV][RFC] Deprecate type juggling to and from bool type within the function type juggling context Date: Wed, 2 Jul 2025 14:39:25 +0200 References: <3Yl0UGauXmKqk7s7Hqbv6iaXru-hZHf8Wj6VjwwihgRSaqZo5EZ2ndsOle-ae41C-lvnirynWt6PpuD7UJPL0zPCw18QHFE81Eb--fiiEbc=@gpb.moe> <57000669-EBAC-457D-BAB9-5B7CA2497BEA@cschneid.com> <_PD6Pm_be1h0d70p046HnYr9o1bvN-7Z1p7StpDPbA_r4PupUJF9U9jmsG44ZKoeQFB-x0qtZxVm4XlngoBJhBOl9BTo11Qf1hJ5g6Psho8=@gpb.moe> To: PHP internals In-Reply-To: <_PD6Pm_be1h0d70p046HnYr9o1bvN-7Z1p7StpDPbA_r4PupUJF9U9jmsG44ZKoeQFB-x0qtZxVm4XlngoBJhBOl9BTo11Qf1hJ5g6Psho8=@gpb.moe> Message-ID: X-Mailer: Apple Mail (2.3826.600.51.1.1) From: cschneid@cschneid.com (Christian Schneider) Am 01.07.2025 um 14:40 schrieb Gina P. Banyard : >> The RFC talks about "from" AND "to" bool conversion but the examples = under Backward Incompatible Changes only seem mention "from" bool, is = that correct? >=20 > I didn't think adding examples for "to" bool was useful, but I can add = some. Thanks! >> I tried the implementation in branch bool-juggling-dep-poc on = https://github.com/Girgias/php-src.git and encountered two things: >> - php -r 'strlen(false);' produced a core dump with = Zend/zend_API.c:561: zend_arg_from_bool_deprecated: Assertion = `func->common.fn_flags & (1 << 14)' failed. >=20 > I forgot to update the optimized strlen opcode, I pushed a fix for = this, please pull in the latest version of the branch that has been = force pushed. Yes, that fixed it for me. >> - array_slice($a, 1, preserve_keys:"a") did not produce a warning = even though I would have thought that is a "to" bool conversion. Am I = wrong? What should I test instead? >=20 > I haven't had time to look at why this is not triggering as it should. = But some internal functions do weird stuff sometimes. Not sure if it was a side-effect of the other fix or if you fixed more = but the code above now correctly reports a warning. Thanks again, my evaluation with our code base show very little impact = so I'm positive about the change, - Chris