Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103668 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 3386 invoked from network); 2 Jan 2019 19:38:40 -0000 Received: from unknown (HELO mail-io1-f44.google.com) (209.85.166.44) by pb1.pair.com with SMTP; 2 Jan 2019 19:38:40 -0000 Received: by mail-io1-f44.google.com with SMTP id x6so24843397ioa.9 for ; Wed, 02 Jan 2019 08:11:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=cnaVpZZMMt1Ktfr8bA6pAotEu0vgFcwy17cbEmi2JHQ=; b=RUShukaOsl2xu6VAehupOZkm6sq2yoMrW/Vl+UUI9bgbIAmG5sZCqPSaFoWlQFBgNN dLFOrZCqkrOQG6//y1Otj6oi9dOMhDFIfXAtMl/L1m3mtvQpHJDiEWQ461fOUS41E4WX bJkfkhAzYBo74ONVX1tQVrSyzsdWBCqIFuVzA++wYlEm6xn49Vgyy/Z8SaAUmAcvlSTc c03oXXc0KaknbNVnU/RJTQaSo0+jrL8GQVBedYOxXbyRSL3iz+sv+4DP7OB9B90xnnpO ClYQi6L4ZBY1X54NCmuv7qs6VEMRwNuefKsUov0lw6rvHueXJ2jbpOtQleHll2OXoduo fZPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=cnaVpZZMMt1Ktfr8bA6pAotEu0vgFcwy17cbEmi2JHQ=; b=o+oExyeh30dCbjWvGORultFmEpl1IpTF5iC6HvkESF14gmWr6RQ1ZdXFumNNAPqkAI 3GoPB0/4/rVZnLp1tQzMX/sMF3/s5+N3tcVYDkrkBX33aEdxcK8M1ZxK6x4K6KHenxGQ U5pfQ1odVM9bupRKyeq7DqGkubmmcVHO3pGdbKoeYbtcBICCqJcZk9Keh/3inV9KmT52 6wgYeXm/hfPbfvcMyM+vwBlM0obVxYU4Q/IhQSLvVra6kVf5WwHdv+JwgFpbILFxAgsb np0iJPAR7DNTeegp7QIlC6jMxKhrJ8OFHGkNJTKaEvAPglTIQ/CIaQX5tPOAJHgh2C/a W4Qw== X-Gm-Message-State: AJcUukfKtUKVJ9UlssXwxSazT9shwkjrMa0Flh8P5H65oV+H0lw7Wb/O FYOlTen/xy5q15wZqscJ4ltvoFKEcZm09Lvtz3Y= X-Google-Smtp-Source: ALg8bN7UJb4LSuwl1gfTE7+SPOmf3k9M4KsVv07pQpfAHlqz8t/FAM8tSoyIiIDRl3iaOpPcljbQ4buBR5cSEnQrqGo= X-Received: by 2002:a6b:5804:: with SMTP id m4mr29790689iob.47.1546445480181; Wed, 02 Jan 2019 08:11:20 -0800 (PST) MIME-Version: 1.0 References: <94f5feb8-6589-3a0a-2849-7679cec1858c@gmx.de> In-Reply-To: Date: Wed, 2 Jan 2019 17:11:03 +0100 Message-ID: To: Zeev Suraski Cc: Stanislav Malyshev , "Christoph M. Becker" , PHP internals Content-Type: multipart/alternative; boundary="00000000000082c53a057e7be525" Subject: Re: [PHP-DEV] Inconsistent float to string vs. string to floatcasting From: nikita.ppv@gmail.com (Nikita Popov) --00000000000082c53a057e7be525 Content-Type: text/plain; charset="UTF-8" On Wed, Jan 2, 2019 at 12:33 PM Zeev Suraski wrote: > > > On Wed, Jan 2, 2019 at 11:26 AM Nikita Popov wrote: > >> On Wed, Jan 2, 2019 at 12:30 AM Stanislav Malyshev >> wrote: >> >> We have a rather hard policy against ini options that influence language >> behavior. Locale-dependent language behavior is essentially the same >> issue, >> just worse due to the mentioned issues, in particularly lack of >> thread-safety and the possibility that the locale is changed by >> third-party >> libraries at runtime. >> >> We have removed existing ini flags controlling language behavior in the >> past. I would say these removals were much more significant than what is >> proposed here, but we did them anyway, and I think we are now in a better >> place for it. >> > > Unless I'm missing something, changing this behavior would require a full, > line-by-line audit of the code - with no Search & Replace patterns that can > find these instances in any reasonable level of reliability. Every place > where a floating number (which could come from anywhere, so not very easy > to track) is used in a string context (which too can happen in countless > different contexts, virtually impossible to track) would be affected. > Sounds pretty nightmarish to me. I for one fail to recall a behavioral > change that was quite as significant as this one in terms of the complexity > of finding instances that must be updated. Like Stas, I'm not disputing > that this is not an ideal behavior or that we'd do it differently if we > were starting from scratch - but I also agree with him that it's pretty > much out of the question to simply change it at this point. > > Can you point out a change you believe is as or more significant than this > one that we did? I think the only one that comes close is > magic_quotes_runtime, and even that was significantly easier to handle in > terms of the cost of auditing the code (again, unless I'm missing > something, which is of course very much a possibility). > > The solution for this *might* be a very unholy one - actually going > against our practices adding a new INI entry to would disable the > locale-awareness for float->string conversions; But for upgrade > considerations, I don't think we can even consider simply changing this > behavior and forcing virtually everyone using a non-dot decimal separator > to undergo a full code audit. > > My 2c. > > Zeev > I don't expect this to be a particularly large issue for two reasons: 1. Not many people use this. I'm sure that there *are* people who use this and use it intentionally, but I've only ever seen reference to this issue as a bug or a gotcha. 2. Even if somebody is using this functionality, the only thing that's going to happen is that their number display switches from 1,5 to 1.5. That's a minor UX regression, not a broken application. It's something that will have to be fixed, but it's also not critical, and for a legacy application one might even not bother. I think we should just put this to an RFC vote. We regularly have these types of discussions, and people just disagree about level of anticipated BC break relative to benefit of the change. Nikita --00000000000082c53a057e7be525--