Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117738 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 67949 invoked from network); 17 May 2022 07:37:43 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 17 May 2022 07:37:43 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id BF417180053 for ; Tue, 17 May 2022 02:18:07 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-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,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 17 May 2022 02:18:07 -0700 (PDT) Received: by mail-ed1-f43.google.com with SMTP id j28so7512616eda.13 for ; Tue, 17 May 2022 02:18:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seld.be; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=d6Fq6cyburdE6DYk+n3JNjkGl71ACTzYsI9akNISjfo=; b=ffr9NQsPz4rkzKmms21anJJFseDllefJvDS85fO6LZLKbVkYg1sjtPqNwhe5EQzfPv GfKEoh6uv8U5TiWkjizISeU1qRzbky+YWzJo43jx3qnwpw1x2D5CdE7pujAU9+CL0a3Z x/5vdUFfy6Of0EnwjD1qGVRkjyK0NEO1X7ykHtTzU0Fi77qvdoWf6IwHJaFc8tJyYxki t/kjkpJKV+GI6V+vm5TUGCQDjhi8zqnbfV/KlPApSDwQhteOmcdtPWfl6OTkT+wXRVjw ofs8UkY3+3pcV7mKCWcIyFKFEz44SWwrvGcdw/O4PLmtI1/YQ2m6jor/nilOmSpO5OBp cYvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=d6Fq6cyburdE6DYk+n3JNjkGl71ACTzYsI9akNISjfo=; b=ovW4VLkD2HFqnaTxxtURHQSAae2mepnXOM3o+w8kVfbbIB/b3ngETW19prg3Dot5Fh bcv3X4jaMYreuOxLZCMoWTJwrb0wvtmn0dVer+oVZnNZkd930AiE/TQPMxH3DuSJ5bh8 AI5CeZjZ31iDhBqSllT+uyWPW+nQeoDiN63ujco6nZO6ydShpdqyT0lB9rXQD+03Vt8c yP+xGvBlPItAi5Z955gmeuA7Pns57urNAgVsccY6OnTdRUIt1y7GcSXtSpWvwGHQKKEY ElksfDt3oqTjr3w13f1NU+DAhnvp6FrmZ0/nbR8cOmMXWg2cMuLKcu0XiQxI0zeDs36W 8EBQ== X-Gm-Message-State: AOAM5334m1FggqLbW95T++h07i2+OkuQKQvuu/McyKX7vVc728Abqzaa HMSmcF/qwXFOwN6S+7dxIJIuC8Ab+1DsETHM X-Google-Smtp-Source: ABdhPJyCN3KiPVQsmlr4Ac3Wa93nBodE3/MW5H+gTEufNPLcAc2hwCQFdxfI1Tlhnzg+vyE+KfSfFA== X-Received: by 2002:a05:6402:3585:b0:427:ccd4:bec3 with SMTP id y5-20020a056402358500b00427ccd4bec3mr18027421edc.2.1652779085616; Tue, 17 May 2022 02:18:05 -0700 (PDT) Received: from ?IPV6:2a02:168:4b6e:0:58e0:9a0:d7d1:ff1a? ([2a02:168:4b6e:0:58e0:9a0:d7d1:ff1a]) by smtp.gmail.com with ESMTPSA id 21-20020a17090601d500b006f3ef214e34sm800005ejj.154.2022.05.17.02.18.04 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 17 May 2022 02:18:05 -0700 (PDT) Message-ID: Date: Tue, 17 May 2022 11:18:03 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Content-Language: en-US To: internals@lists.php.net References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [Discussion] Stricter implicit boolean coercions From: j.boggiano@seld.be (Jordi Boggiano) On 16/05/2022 17:06, Andreas Leathley wrote: > Hello Internals, > > After the first discussion about this topic > (https://externals.io/message/117608) I have created a preliminary > implementation and an RFC for making implicit boolean type coercions > more strict: > > https://wiki.php.net/rfc/stricter_implicit_boolean_coercions Thanks for the RFC. I think it's overall a good idea, especially for cases like "false" => true, and arguably for ints >1/<0, but my gut feeling is the string=>bool deprecation will lead to a lot of pain. I definitely see this being done in many places where you expect any string value to be true and an empty string to be false (without consideration for the "false" case which is more common in config style use cases). I don't know what you could do to improve this without making the RFC useless though. I wish these things could be tried out in alpha or even up to early RC builds so we could hopefully get community feedback in before deciding whether it's worth the pain inflicted or not. Best, Jordi -- Jordi Boggiano @seldaek - https://seld.be