Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:104966 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 76862 invoked from network); 27 Mar 2019 17:33:08 -0000 Received: from unknown (HELO mail-ed1-f47.google.com) (209.85.208.47) by pb1.pair.com with SMTP; 27 Mar 2019 17:33:08 -0000 Received: by mail-ed1-f47.google.com with SMTP id h22so14196145edw.7 for ; Wed, 27 Mar 2019 07:26:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=kUdzSVA3EvYTD147HMpKRelsmQV+MoVcefdcCHaKy0E=; b=u+HYTSmCMKIhWv77B2UxYwXhNqWETIPF6zKChmUSDHuyruVVHjAd3gZx6P+Ow8XUs3 NrxtC2xU1cx7/WhejhiTSfOt6dgnhiWsUMLkVCgcP+8HYjFUq8u2r7mGWQwDswBU4baO PEkhab9uDM+OeJBrzvkP6J0Zdgc6V/up1nB8CeawjMTo/aDfpUSY1ucpq7ER5MIs2n96 C+MPiIalWznRZ1C4aLtDc48L73M9IhFnNPtwzx25OfGCTxSRFpeqZNdDhHvGrhg49Fpr 9zG7W+Ox1Dil3GY2CUO/o91O+yb7DA25uhH4pQZoZFcEO1E9SnvhtZrqBppQBIBC6Iww Lizw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=kUdzSVA3EvYTD147HMpKRelsmQV+MoVcefdcCHaKy0E=; b=i9SRqHHS3QW8U0BlC6gYDM71H8I0n3fjkTVcqAzDREA7rbLx3hgondOZ/J9Th0fRij pjd5ntdNialrXB8xe9WZRhTyaZV9Q5hnWCrC8ksg1A3A3jvjfwngKcX5OktaG2bNwx/w pqlDTSBf8MiO30RzawZjo8i6OxVlGBs2eeGJSpmdf8BlIqV/opNUW9XmApEQ2x1SDJ4x sSNKDs7sZbtq++JUYW5t7dQ0EGFmodoJc0s7hX5VPYbRYbMbpXVkhniqTJKdYn4dj7nM 9Taqe78SVNSxoGU4m7W31OSu/aL3gPP/KhuuFA39KCOGKLAn3J6qxUvK3rcq1N5hHaFX qDmg== X-Gm-Message-State: APjAAAVa4yUnzz0pPtZb/jv5viRmghcAAKMzWksmnu9nO2lKI70F9GSO STypeejnerqYd+uwYQ4JWZU= X-Google-Smtp-Source: APXvYqwjxZcnYZXknyOWWcAA7SiRlVh/nor+dccOAOaOvuJ0MJOzsXDNg8kWvCvR2mXUvai+4Ut79w== X-Received: by 2002:a17:906:484:: with SMTP id f4mr9192484eja.49.1553696806464; Wed, 27 Mar 2019 07:26:46 -0700 (PDT) Received: from [192.168.0.63] (84-75-30-51.dclient.hispeed.ch. [84.75.30.51]) by smtp.gmail.com with ESMTPSA id g27sm7452033edg.77.2019.03.27.07.26.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Mar 2019 07:26:45 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) In-Reply-To: Date: Wed, 27 Mar 2019 15:26:44 +0100 Cc: Rowan Collins , PHP Internals Content-Transfer-Encoding: quoted-printable Message-ID: <481CB4EE-599D-4CFE-9F5E-8B04EC2BAB35@gmail.com> References: <6C077569-A049-422B-A4CD-6EE5F8DEC388@gmail.com> To: Benjamin Morel X-Mailer: Apple Mail (2.3445.102.3) Subject: Re: [PHP-DEV] [RFC] Permit trailing whitespace in numeric strings From: claude.pache@gmail.com (Claude Pache) > Le 27 mars 2019 =C3=A0 14:29, Benjamin Morel = a =C3=A9crit : >=20 > Thinking about this a bit more, what about following JavaScript = semantics? I find them really good in this respect: >=20 Arithmetic in JavaScript cannot be used reliably (in general) without = converting your data to the proper type, because 1 + 1 gives you 11 if = one of the 1s is encoded as string. PHP does a better job in that = respect. As a result, there is good chance that people (it is at least = the case for me) are more confident to rely (often implicitly) on = automatic type conversion between strings and numbers when doing basic = arithmetic in PHP than in JS, including for comparison of numeric = values. About leading/trailing whitespaces: usually, numbers encoded as strings = do not contain them; so that it may be OK to consider strings containing = them as non-numeric if we want. =E2=80=94Claude