Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:104297 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 80441 invoked from network); 8 Feb 2019 02:25:59 -0000 Received: from unknown (HELO new1-smtp.messagingengine.com) (66.111.4.221) by pb1.pair.com with SMTP; 8 Feb 2019 02:25:59 -0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailnew.nyi.internal (Postfix) with ESMTP id C1D558331; Thu, 7 Feb 2019 18:07:43 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Thu, 07 Feb 2019 18:07:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=benramsey.com; h=from:message-id:content-type:mime-version:subject:date :in-reply-to:cc:to:references; s=fm1; bh=a7obBOmzzbfVA/LHHODtR8H dGrzuFNCvfdLxQRrkSi0=; b=e7qqwGkSdSttEBcDuaRZvRXOkqem/snDb80BMlJ Y5n/e6Wfq3xw5k17U+M0Rshf5DPBHtrnt6uGvq5V3eUVLoN+y6RwC2klnTljjZXs XBvBVHONjO35/BZ98FyeJWdTVcdk1hYHmxkXh6e4tYwl3YXM5kwrCpXRf7QDgmj6 AL+wqK+ZZFmZZkEoFdYJf20/otlxx1OXZeNGZS24LFA/y0iNARL6dWwr7vQeW44+ 8hxEDWvm6xqcbS0urSoXdywIWhcf19BZeM43ARXkBCWJgsOJYXFGIH4f//c8+36x pjtuZAbITuEZ8aekZwpPy10h+yWfVSn18fd/vWfZ+zgeu/Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=a7obBO mzzbfVA/LHHODtR8HdGrzuFNCvfdLxQRrkSi0=; b=eRQxkEo3fW169gG3BlP/j5 lC/9tiQC8oyBSyOSGdYNLx1psgDZEm8GoW768nbVUJC5s4Q5h77dBWhvRFyWcWT9 Nx4lk8z15svqjBp+S+XEFh+yIemx2JgDFNFRbQPDufUcJTZfaG3MJ31GD2b9cAgY cNONpaPdG7OziEriRjzxO2OVuA8Eu8JAyXI2Z9YpbChpakLtGMlliFunlEVORqKz 1DeMatlToL5bHCyw+D2Nx5RAqzGa88KpA5Oe8h4UPm1suddvMXh+bzwxGSsKmL7n R95/AhnDD1qMskP8qD6ZikwhllofGSUIJvVp6chWOKCwQjr85Oouz933U7uFwjvw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrledugddtfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthenuceurghilhhouhhtmecufedt tdenucesvcftvggtihhpihgvnhhtshculddquddttddmnegoufhushhpvggtthffohhmrg hinhculdegledmnecujfgurhephffktgggufffjgfvfhfosehgtdhmrehhtdejnecuhfhr ohhmpeeuvghnucftrghmshgvhicuoegsvghnsegsvghnrhgrmhhsvgihrdgtohhmqeenuc ffohhmrghinhepfehvgehlrdhorhhgpdhtfihithhtvghrrdgtohhmnecukfhppeeliedr iedurddujedtrdehtdenucfrrghrrghmpehmrghilhhfrhhomhepsggvnhessggvnhhrrg hmshgvhidrtghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from [10.10.42.56] (h96-61-170-50.lvrgtn.dsl.dynamic.tds.net [96.61.170.50]) by mail.messagingengine.com (Postfix) with ESMTPA id CFA7810311; Thu, 7 Feb 2019 18:07:42 -0500 (EST) Message-ID: <55E49E9F-9E09-4AA2-ACC3-C0FF3FE7EF09@benramsey.com> Content-Type: multipart/signed; boundary="Apple-Mail=_2B8AB3CF-1F13-46FA-A03D-55DB80BF536D"; protocol="application/pgp-signature"; micalg=pgp-sha256 Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Date: Thu, 7 Feb 2019 17:07:41 -0600 In-Reply-To: Cc: internals@lists.php.net To: Vladyslav Startsev References: X-Mailer: Apple Mail (2.3445.102.3) Subject: Re: [PHP-DEV] Make bcmath functions more strict From: ben@benramsey.com (Ben Ramsey) --Apple-Mail=_2B8AB3CF-1F13-46FA-A03D-55DB80BF536D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Feb 7, 2019, at 11:47, Vladyslav Startsev = wrote: >=20 > Hello everyone! >=20 > Recently I noticed that there are strange behavior going on if I use > bcmath functions (some examples you can see here > https://3v4l.org/D3s7J). I also previously had little discussion with > Sara Golemon on twitter about this > (https://twitter.com/SaraMG/status/1087902930110480384). So to > conclude things that I want, is drop behavior (they should throw > invalid argument exception) that I've showed in the first link and as > Sara suggested add deprecation warning (but I think it should be > E_NOTICE level errors) in 7.4. Another option to consider is to adopt the same approach as standard math in PHP. Here=E2=80=99s an example using standard addition for the = same values: https://3v4l.org/iMGg8 So, maybe it should emit notices and warnings instead? Notice: A non well formed numeric value encountered in=E2=80=A6 Warning: A non-numeric value encountered in=E2=80=A6 Cheers, Ben --Apple-Mail=_2B8AB3CF-1F13-46FA-A03D-55DB80BF536D Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iHUEAREIAB0WIQToXQMR3fpbrPOmEOewLZeYnIwHGwUCXFy6PQAKCRCwLZeYnIwH G7bWAQCWc5QZ501Bxa6hiYVlnncErEWQP2kM3qw+LQ4Yz6ULCwD/QYug8NuEvUyJ Ai4r6G3IRh9deXkwByR7rMDgLPJa6SY= =4BvQ -----END PGP SIGNATURE----- --Apple-Mail=_2B8AB3CF-1F13-46FA-A03D-55DB80BF536D--