Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85640 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 29365 invoked from network); 1 Apr 2015 17:08:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Apr 2015 17:08:20 -0000 Authentication-Results: pb1.pair.com header.from=mike.php.net@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=mike.php.net@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.177 as permitted sender) X-PHP-List-Original-Sender: mike.php.net@gmail.com X-Host-Fingerprint: 209.85.212.177 mail-wi0-f177.google.com Received: from [209.85.212.177] ([209.85.212.177:37365] helo=mail-wi0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D5/01-21906-3062C155 for ; Wed, 01 Apr 2015 12:08:20 -0500 Received: by wiaa2 with SMTP id a2so74645449wia.0 for ; Wed, 01 Apr 2015 10:08:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=hphRZLHyh0rIEKV/5PALXTmxVMel5fgy0xIiZpFp+08=; b=IxIaTOtZwot0wzniJgrbdPxeOfLYZmHoDJuovJBvT7p1ib2GkiaaQWzLtZwjL7Ryvo Bc4ngCSrCKsUT5+VqCcQLU3/0JrPjFAdzGOG6J8Oe1Yhx+ppJL+VvBiQhHoXwe15zNZ3 IzhBRgNfUGiwfY3NICFyyV1GlZiJgjw75TFYYMBRj3RElkDX0HzyCdRtg13yCc5ImhRi GzKMw39+cKuVSBXOVITfv5UejxaUPu2eYkrLBWfD2PIojeDoUuc4wZ1GzuXwd39TgL8+ DsmLYTNq3/x33dUKtVWl6RUh86ElZbmMKt8w78oPz/CwJY7aWEoUFWKGBxh5b0/1XhY/ f6lQ== X-Received: by 10.194.190.10 with SMTP id gm10mr86396353wjc.91.1427908096438; Wed, 01 Apr 2015 10:08:16 -0700 (PDT) Received: from lepisma.bemi (89-104-28-113.customer.bnet.at. [89.104.28.113]) by mx.google.com with ESMTPSA id cz7sm3995909wib.15.2015.04.01.10.08.14 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 01 Apr 2015 10:08:15 -0700 (PDT) Sender: Michael Wallner Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) In-Reply-To: Date: Wed, 1 Apr 2015 19:08:13 +0200 Cc: "internals@lists.php.net" Content-Transfer-Encoding: quoted-printable Message-ID: References: To: Dan Ackroyd X-Mailer: Apple Mail (2.2070.6) Subject: Re: [PHP-DEV] Deprecate setlocale? From: mike@php.net (Michael Wallner) > On 01 04 2015, at 18:15, Dan Ackroyd wrote: >=20 > Hi, >=20 > I'd like to get people's feedback for the idea of making setlocale be > either deprecated and to be removed eventually or just increasing the > warning level against people using it. >=20 > The short version of why we should do this is that setlocale breaks > things. It is a process wide operation, that is not thread safe on > most platforms. Although people use it to alter the way strings are > output, it also breaks libraries that are assuming that they are > running in a "C" locale. >=20 > https://bugs.php.net/bug.php?id=3D59571 - breaks Imagick > https://bugs.php.net/bug.php?id=3D54538 - breaks NumberFormatter > https://bugs.php.net/bug.php?id=3D66108 - breaks constants > https://bugs.php.net/bug.php?id=3D67127 - breaks DateTime > https://bugs.php.net/bug.php?id=3D69348 - breaks MySQL >=20 > And there are quite a few other bug reports where setlocale is doing > exactly what it is meant to do, but the unexpected side-effects are > catching people out. >=20 > We have libraries that ship with PHP for formatting dates, numbers etc > that actually work, and don't break other libraries. >=20 > So two questions: >=20 > i) Are there any reasons why we couldn't or shouldn't plan for > removing setlocale at some point in the future? i.e. does it do > something that isn't supported by other libraries in PHP? >=20 -1 I don=E2=80=99t hink that we should restrict access to standard library = functions just because something might break due to usage under wrong = assumptions. > ii) If it's not possible (or desirable) to remove it, how could we > increase the warning level against using it?