Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117618 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 69817 invoked from network); 26 Apr 2022 13:01:13 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 26 Apr 2022 13:01:13 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D4172180541 for ; Tue, 26 Apr 2022 07:36:28 -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,FREEMAIL_FROM,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-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (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, 26 Apr 2022 07:36:28 -0700 (PDT) Received: by mail-wr1-f54.google.com with SMTP id j15so12519017wrb.2 for ; Tue, 26 Apr 2022 07:36:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=gU78bWv3q9NbYgVtNlkoB1f7ejgk5O7dFp69A8HWW+0=; b=fMRNH4HV7j0eIusxPgwsx/JB9Ym44OXNZM/vhfIlvsJhbelUYwr0/Oja0SW3DR4Fxn q3hsSCa1qGuXzrSP7VXaPn8iIClPVZr+zYCujXCkqam7YdNaAJU2LZJTRguyoOheEEyF LDxQi/Df31SFy1xui3KgtRfZa9j9pCurmaoVphOpZMH2xC2jQ0L0/Hp/9bvWd4uUOiSr 06p6t8Egx8G+Lr2yoNhyHyMZthCsouq2lnMc6lIv3IczaDeNXTCeuYPFXFoHW61CPCzf Pyx6CHPRBjx6gFBst7bJl8kxxZX5Mkfsw7fcFAsxSrmI7giM5tKkFD/W77WlmFiojdtz p0Eg== 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=gU78bWv3q9NbYgVtNlkoB1f7ejgk5O7dFp69A8HWW+0=; b=zwzG302XYIK11nXKpeXy4FgyX9HK7NIkoZ1xQI9oeJbiJz0UBLvDLQiziI7anVKVUb Wifzbqb6V8y9fgHybYF5ijSOcDC3j2avnAo6dFFz7kXmVUSMtgC4FhjbiIavxl0n5W2w vxdZq9Gd8bo+myqyVIyxIlp9kx1xyI4DQpJAbJWusheQHfWXxzMIJJNefkHEDKMmjT4f gwXT5k8Dt5Cmiz2ZjSBK+FJElWmAOZ39TQSLzRqDGF2dIG1QrZxOokL2hOlO6c9MgazZ xvVQ2+X8AgJFf4Uh/rXxtpw+sZNvnvP7MSNeww4PHJrsFD2+FUE1L0UVLfCdmYD4VzuX Dw8g== X-Gm-Message-State: AOAM532561D+j7/ZJZS0qTj/VZV+8miwKuftHRuqngts236DU7kwS+ea DmDtaQEARWzP9tL99Z3DeFcSKhMzcJA= X-Google-Smtp-Source: ABdhPJxZ6bvjLa7GGNQLbD/uw8ZNngeUl+1R3QKsODWsxgEqPmv11h7wT1n4lJXBKLADwKfh4mNKiA== X-Received: by 2002:a05:6000:1814:b0:20a:cb21:8781 with SMTP id m20-20020a056000181400b0020acb218781mr16789244wrh.488.1650983785627; Tue, 26 Apr 2022 07:36:25 -0700 (PDT) Received: from [192.168.0.22] (cpc104104-brig22-2-0-cust548.3-3.cable.virginm.net. [82.10.58.37]) by smtp.googlemail.com with ESMTPSA id d17-20020adfa351000000b0020adbfb586fsm6129642wrb.117.2022.04.26.07.36.24 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 26 Apr 2022 07:36:24 -0700 (PDT) Message-ID: Date: Tue, 26 Apr 2022 15:36:23 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Content-Language: en-GB To: internals@lists.php.net References: <3fcdfa2c-7a9c-d634-ea56-8b1e5bf1a911@gmx.net> <5ceeb3f0-0f01-8b93-00ca-9947c9c69e4c@gmx.net> In-Reply-To: <5ceeb3f0-0f01-8b93-00ca-9947c9c69e4c@gmx.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Stricter implicit boolean coercions From: rowan.collins@gmail.com (Rowan Tommins) On 26/04/2022 14:53, Andreas Leathley wrote: > 'on' is only true by "accident" though, because it is a non-empty > string, not because of its meaning, and then it is likely that the value > 'off' could also be added at some point - which also would be true. The reason I gave that particular example is that it's the default submission value for an HTML checkbox when checked; if it's not checked, it has no value at all (not even an empty string), so in that particular context there is no corresponding "off". I think it falls into the same category as something like '1e3' being considered numeric - occasionally useful, but probably not worth the potential confusion of a special case. Regards, -- Rowan Tommins [IMSoP]