Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103660 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 96207 invoked from network); 2 Jan 2019 12:54:12 -0000 Received: from unknown (HELO mail-io1-f51.google.com) (209.85.166.51) by pb1.pair.com with SMTP; 2 Jan 2019 12:54:12 -0000 Received: by mail-io1-f51.google.com with SMTP id b23so3149344ios.10 for ; Wed, 02 Jan 2019 01:26:47 -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=nv+f/DSwEUlUeWHGpYu4P6osMxy3EH4d2ysbCEVDAM4=; b=AOOCBpArC6OuMcuf7RzrC0IS+5sxsXT+TPBH27cSCgkEQHa0cZVMJG5lSpzKWGkq1H bQNHNNfoGSU78HxoVI55FwDsvjVnu8JqyREfT9ZbgfGXKqFhF2Ntz7g893SadM4z+cf9 tD6aolL6omu57kkAG6UhKIM9KJMQ2Qu6iqHBvsG0zQUdi6ObUzTLbNPGwZWDZrA4u4t7 TMYNn5uT7Sdt/7KtRx+fyY6DtXRWZM0zkInhWJX3NqESsMjR4kM0M26EonkIlYvoV/hs fqIy/cEeigunvrqEQnl77CfYeoZn808QHti17ds9KR0mUrvMsk3EgayeJD7U+vw4m78L TWUA== 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=nv+f/DSwEUlUeWHGpYu4P6osMxy3EH4d2ysbCEVDAM4=; b=pIe/UlyTFBYDA7IWdG6W7EURHW/U7TXuV0uuuI7qtIC+DDlEzMHwqkZsn1FmRYyj9o A9tdueRE2Cd7g4oEY9ztuGGkhXpULn91FcGotfWYfImT5lQNLFA38otKpyPKVVjB8APS uOn5Ai4wJmJpSg9jvGn8pyyYgOK9/zYbCFD61x+UmTo7Q0EiB7ciFT/oymX/o6LfWTEQ BxrkxYF9FDl4xVgPK9VOdWUz2hF24RFL/snDOHzB2dUKgzQAwgpID/bEHSXl28v/JNam K0suP9Z+o/tqIimmFWsx1rXZKKPl+Oc4vl1tgbvYgc+KAcJtCOfbmiRFW9cr+3XVGrAu e1TQ== X-Gm-Message-State: AJcUukdoCrSNgo+p7r1nRnlrQzZRm/lQbW/ESt5C8jlQWkgGfmbxyCO0 7F9vfArfRVlZ6LjeagmjsRxgxu0S7ElWcYlBSwE= X-Google-Smtp-Source: ALg8bN7EcdsUUOIvq8K8uj/RPhH/CLNyWQolzjbogPR+WWANg24q1UqSfEnCu5upyGVMquwOLBXNSuMtf+PfG4aUrv0= X-Received: by 2002:a6b:5804:: with SMTP id m4mr28945232iob.47.1546421207510; Wed, 02 Jan 2019 01:26:47 -0800 (PST) MIME-Version: 1.0 References: <94f5feb8-6589-3a0a-2849-7679cec1858c@gmx.de> In-Reply-To: Date: Wed, 2 Jan 2019 10:26:30 +0100 Message-ID: To: Stanislav Malyshev Cc: "Christoph M. Becker" , PHP internals Content-Type: multipart/alternative; boundary="000000000000bf37f2057e763ef9" Subject: Re: [PHP-DEV] Inconsistent float to string vs. string to floatcasting From: nikita.ppv@gmail.com (Nikita Popov) --000000000000bf37f2057e763ef9 Content-Type: text/plain; charset="UTF-8" On Wed, Jan 2, 2019 at 12:30 AM Stanislav Malyshev wrote: > Hi! > > > So yes, (string)0.3 should return 0.3 in any locale. > > If we designed it now, without any doubt. But since we have 20 years of > history behind... I'm not so sure. > > > Finally, I don't think that the global locale is the real problem for > > PHP. Rather it's PHP locale handling and the fact that setlocale() > > works per process (and not per thread). When PHP starts up, no locale > > That's part of locale being global. Though even in environment where > threads are not involved, many apps do not account for locale quirks. > 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. Regards, Nikita --000000000000bf37f2057e763ef9--