Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117635 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 52947 invoked from network); 27 Apr 2022 10:23:46 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 27 Apr 2022 10:23:46 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 215891804C5 for ; Wed, 27 Apr 2022 04:59:14 -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=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS8560 212.227.0.0/16 X-Spam-Virus: No X-Envelope-From: Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (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 ; Wed, 27 Apr 2022 04:59:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1651060752; bh=aple/v3SRb/hWmlrcvm7Vm2I7kS8W9Bb8bPx6cX9Dmc=; h=X-UI-Sender-Class:Date:Subject:To:References:From:In-Reply-To; b=MM2+AQi5pmDBnz7pBh87TgicB6Cd9ptGF2UMJmdt+HNsOmYdvOxBEDClUWKablHDq 8sUntTfvo2l2eMVWihGA36OTkDZpUZjVFFb6eY2i9JLlDTHcewyBVCVOJSyQQ7IPjU 3MYAl4Ew5SL3hJsgYftDXbTLCP/qvGAQsju96J+4= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.43.136] ([109.43.51.163]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N3KTo-1ntCph3TdK-010Lay for ; Wed, 27 Apr 2022 13:59:11 +0200 Message-ID: <38cf4a37-fd57-1402-8a62-8b17a20c2eee@gmx.net> Date: Wed, 27 Apr 2022 13:59:11 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Content-Language: en-US To: internals@lists.php.net References: <3fcdfa2c-7a9c-d634-ea56-8b1e5bf1a911@gmx.net> <5ceeb3f0-0f01-8b93-00ca-9947c9c69e4c@gmx.net> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:7fXWbXKeikrch8ihvViMdI9/MxkplIRqzI2iCBY5HeyECYb0yAG +cJE0mISK3xAWE1RS3Sj04N4DQKWhg2vYYYcoFfK27NQvLDeyMCJ3vfpNYVz6DlkLZBJnzR jspjVGpfyz4GuozQdti5pg+NDpXuOOLyKdzFt6ydM/tyMQgo3k7UNiu01drKrHpSDx5FKpJ nqiX7/KSYUfyx38+4Htaw== X-UI-Out-Filterresults: notjunk:1;V03:K0:nbN8QRGBpt4=:iVhEhhTb1DAI+tD9LiRebG ZNrQg9N1E4+MEzVVhmobo3S3S5/LpTKWZ/7og5Dqo572cYKYvkku1a0rrOX354xffHERIzxdj q21C1Xh20YSbnVI9NeJGuvlpzrMWo3kSrJaOR5SAb9ntdaC5atOBMcyRR0wWvUEER0XO9OJdK qYwYL7HosoxFLME66JpJFw+9Ufj1ctZRwdNE+EInV2hNQYhqn0xLM/u5qmrySz8tJfiE170MU zmF1GGZMXaskbA9UdlbBD/pJVfh37T/kVQgFf5uei54Zc5mBMitkv5QkVMSPhtI21vhPf+yVe qJ11gislW/lphUZ4ix5oplpRIuWhwS521Ddp2hD27gg02ypBdFY0UoRs8lIvX53bN6JIS5R9w uSQzyCB2cwgTshs9ee/lj03qZU5O1BtbyGPjD96pkXwY5dpfy3uKxgxofiIeAjoDNQPqmxPuj 5nW3Q/PeXBmNBa37J6eWJJ8dGH1Ip7IzXbwVszIjAlqkHEWew2BJYfF/Dm6N+rw3VhewaIax0 SCNWRhWh/S5YnRF194/0OVOshsRY+OQtXAZf85uZF+tsM8Zzp0X8c0z/iUT/gdu4ZF17gTttt hEFzQwVXS08eos+vk0GdHOFGJBsGgJIUoMTCaf+mmlOiCD3o08lONO/zAS6m5BNgMKYmNqbCT RroEvAcrRmoHpEcY5Ci+OVaVRNmD8d0yPKcczIUGJ8aAWqhWumGa7mZwFt/9Mn+YQgUCFI0Tt +E/V2hwZKpW3eU6qZhk9+qRfegZ6yWQb1eRApafQH2cZhrlroZmSB9KPSa+XoAwxoYGu+DuBU wAmlQISuq0xZH7GrPus0rd1R4dBOkPwAwyN3UKD442NkU/zOV50Os8Ci7CkTd9eDcSDfGyTHb iMkt5fCVD8cDRxN5ED03LzJZGJAzPxu1CVzGusBzgiTRFVnP1G3Z8H3sMxjJxT1G4ODbhItin hraD2Gvb58zb+SiNb9gdhib8MRjyoX2SwTrLmqnkLaSrsU/0oFa9vj+Wlh5XIAJiyJ70U8RVm IWhkJA216VUIUMxYBp/bUCNrN/riI7n3/5w85cScw4KJSINOddxDCdgUx4Rcmx0MFMw80o6zG 6RNdGwsLApw1/4= Subject: Re: [PHP-DEV] Stricter implicit boolean coercions From: a.leathley@gmx.net (Andreas Leathley) On 26.04.22 16:36, Rowan Tommins wrote: > 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 valu= e >> '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". Interesting, I didn't know the default value of a checkbox is "on" if no value is specified. That might make it another sensible value to accept for implicit bool conversion, even though I am not sure how many checkboxes are used without setting an explicit value, but it could be considered an established value, especially with how commonplace HTML forms and checkboxes are in PHP applications.