Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:104530 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 98322 invoked from network); 27 Feb 2019 11:57:40 -0000 Received: from unknown (HELO mail-ed1-f51.google.com) (209.85.208.51) by pb1.pair.com with SMTP; 27 Feb 2019 11:57:40 -0000 Received: by mail-ed1-f51.google.com with SMTP id a16so13209336edn.1 for ; Wed, 27 Feb 2019 00:44:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=Mf8lvtDS8p/B/glt1uD5+G9nLfIZWpn9jN6YHoyT+fs=; b=QsbRQE4qpStNQLmIT7EquPJB6p3RdSkef6Y1dNlesCwdLpx+oeffg1VFtAzRkf5tHu 85M9vTrtVcrUIYXr2mA77SmyqHUF2i9S8N6MK1WEsshODIeVgrlQmOB3SOBxqV6cOkHI ty+R/reKaRutqtTxuyeP/m78rFD/bkLr5oI4/NmfSJvTUdr51cqVWkhEd2Jl20cXqTR6 havOdYiTY1J3poHLbDIUm8/JyBd2TbJv/YzwQAt/8XYCsI6nsFv8t/+6I0wLQNc6HBo6 rUpo30Ge3DT3BBsTYwaiv8VF0AGTz0LdiWiUtUws6M+lV4e44YFmRdyoD1aQYmDs8gEB 5caA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=Mf8lvtDS8p/B/glt1uD5+G9nLfIZWpn9jN6YHoyT+fs=; b=NtWsip+xC4EANM84uE70peItQ3/aJdZ4gIBNe67q0vT6dq8GXIou/J0+LfwvPk8z65 dGiGnTvBRkNev4HV+c6pUOa4hRYpHzwYvVYcixvCmy6wx9Mi9UTIXkJDjhlpbFh+36jG KP88qVQvGb6mEsPtgjgyYSnwzdsHFS+BjvvrN7vfv3OTLwQVfl2Icjc6M2i69ZTHniGU YFaB71a6W6q/VaRCt4QEtqptw7vUAubF7O3XbuZbS0e6r5oEb5cwdBxYCCZV5o1ftrOg MHFyAH9NgHctyc2Od7aiCWQsZs6iOwfJ+iDSQ5O+wvllzIRFwECv9Mf/Jr8+/aSqDctH RsCw== X-Gm-Message-State: AHQUAuaJ42s3koCTP/H/jKyA7sj+MEu514ze4yCKx6Yr+gBNWhKbO3k7 uZ6zruSIGBAr5Bbr6hcCkcg= X-Google-Smtp-Source: AHgI3IbTM9eGG5BjimBpF3FEvhIyvaTCrsGDm7tx44jgq5zX5p8LIR2KAPRSLDxy2r+5M2Ml9hAFwA== X-Received: by 2002:a05:6402:1817:: with SMTP id g23mr83018edy.295.1551257055708; Wed, 27 Feb 2019 00:44:15 -0800 (PST) Received: from [192.168.0.63] (84-75-30-51.dclient.hispeed.ch. [84.75.30.51]) by smtp.gmail.com with ESMTPSA id o8sm716249eju.0.2019.02.27.00.44.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Feb 2019 00:44:15 -0800 (PST) Message-ID: Content-Type: multipart/alternative; boundary="Apple-Mail=_DBA74481-14A6-4CC7-A979-A41B85BA300B" Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Date: Wed, 27 Feb 2019 09:44:13 +0100 In-Reply-To: Cc: Nikita Popov , PHP internals To: "Kingsquare.nl - Robin Speekenbrink" References: X-Mailer: Apple Mail (2.3445.102.3) Subject: Re: [PHP-DEV] [RFC] Saner string to number comparisons From: claude.pache@gmail.com (Claude Pache) --Apple-Mail=_DBA74481-14A6-4CC7-A979-A41B85BA300B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > Le 27 f=C3=A9vr. 2019 =C3=A0 09:06, Kingsquare.nl - Robin Speekenbrink = a =C3=A9crit : >=20 > As of the 0 =3D=3D "" bit: I do think that an empty string is = widespread > regarded as falsey-string... Thus 0 =3D=3D "" sould IMHO return = true... >=20 0 =3D=3D "" evaluating to true has been a footgun for me in the past; = something like that: ```php $state =3D $_GET['state'] ?? null; // ... switch ($state) { case 0: // when $state =3D=3D=3D "", this branch is incorrectly = chosen // ... } ``` where the `state` parameter comes from