Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85699 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20533 invoked from network); 2 Apr 2015 21:13:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Apr 2015 21:13:44 -0000 Authentication-Results: pb1.pair.com header.from=danack@basereality.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=danack@basereality.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain basereality.com from 209.85.215.53 cause and error) X-PHP-List-Original-Sender: danack@basereality.com X-Host-Fingerprint: 209.85.215.53 mail-la0-f53.google.com Received: from [209.85.215.53] ([209.85.215.53:32930] helo=mail-la0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 98/0A-56257-701BD155 for ; Thu, 02 Apr 2015 16:13:44 -0500 Received: by lajy8 with SMTP id y8so68706241laj.0 for ; Thu, 02 Apr 2015 14:13:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=VSbNI94LCAZzlqOCKD5Z7BKH1rUdlw1oeRog6c8TJkY=; b=Ud+/FaezUq7H/SicOI0NGIlQ0wx7FD7woQQSYZ9RxElnW9HRpL+PAe4JVbP+TKXmt7 JI3wR2VOdQx5qAUHSTeJAfoMTXmXm8X0zLmPKZX1f0rDiGkXHl4Ou1DVGqIt3dVB2M/T Pk4F5n3mrG4MlKUPmJgtxFNxl2ov6CKVR5/2Ou/HN/bn+e9n0lwMRslHy2MiWy/b1DPM +R/NgqJhLgMzjjcIynaPrQMEQrcPzdstArRtONDAwZO9IaSGXPqChqRlGRZpeqz8XXzl Q6p5xnA0IhWl7TQK9sQQEz1+W6rRp3xMFNDC8OeH/H0ZMGl562G2ySJ+nYFZd8/jA9EX Mrxw== X-Gm-Message-State: ALoCoQkyZXwgA5xB5T+xIx6nYDaoiha2cPQkvLdLQAwj1ur3V66vVoplzYIkQnpVRt0Ck4/7oovu MIME-Version: 1.0 X-Received: by 10.112.14.106 with SMTP id o10mr41194184lbc.2.1428009220077; Thu, 02 Apr 2015 14:13:40 -0700 (PDT) Received: by 10.25.87.202 with HTTP; Thu, 2 Apr 2015 14:13:40 -0700 (PDT) X-Originating-IP: [78.144.121.114] In-Reply-To: References: <551CEDF6.7090408@lerdorf.com> Date: Thu, 2 Apr 2015 21:13:40 +0000 Message-ID: To: Ryan Pallas Cc: Adam Harvey , Keyur Govande , Rasmus Lerdorf , "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Deprecate setlocale? From: danack@basereality.com (Dan Ackroyd) Adam Harvey wrote: > What about just adding another function: setlocale_global(), or similar? Do you mean setlocale would become the thread safe one, and setlocale_global() would be the current behaviour? If so, that would be a BC break for the small number of people who are deliberately using setlocale globally. We could do that at a major version I guess. I think the ini setting is still better - it allows people to use code that was written assuming that setlocale was safe to use, rather than forcing them to change it. It might be best to introduce both setlocale_ts() and setlocale_global(), so that users could call either explicitly, and have the ini setting control which one setlocale() points to. If we did that we could also then plan to eventually deprecate both the ini setting and the plain setlocale without _ts/_global. Ryan Pallas wrote: > I like the idea of an INI actually, but I would make it default to the current behaviour and user education so those who need TS know to change it. The problem with that is that for people who aren't aware of the setting, they wouldn't know that they need to change the setting. Instead they just want their code to work properly 'out of the box'. For the vast majority of people calling the thread safe version of setlocale would be what they problem want it to do, and so PHP should default to the right thing for the majority of people. Of course there is a separate argument about changing the behaviour at major/minor version, and if this was introduced then having to `thread_safe_setlocale=off` for 7.1 and `thread_safe_setlocale=on` for 8 could be correct. cheers Dan