Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85464 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59262 invoked from network); 25 Mar 2015 13:44:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Mar 2015 13:44:21 -0000 Authentication-Results: pb1.pair.com smtp.mail=are.you.winning@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=are.you.winning@gmail.com; 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: are.you.winning@gmail.com X-Host-Fingerprint: 209.85.212.177 mail-wi0-f177.google.com Received: from [209.85.212.177] ([209.85.212.177:34053] helo=mail-wi0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 56/44-36345-4BBB2155 for ; Wed, 25 Mar 2015 08:44:20 -0500 Received: by wibg7 with SMTP id g7so74783913wib.1 for ; Wed, 25 Mar 2015 06:44:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=45PwFxQNh28uc7+E4WiRJux+umF1PXQegZfQ0NtxvUg=; b=s9HyXntFUDgkKDgITNhtumAl7FrmdXX8R1dPC5TE6EaUS7gEUMrdfYvN23SfP4U6Q3 S+x1q8+yjPxG+qIRk4ToCfIzojXSY9TV6P5VntcMKhNMEauOhzxoAeGo/7qtqMtrDXoy GsAwWZsrGmsCbM45k4lyLC1n2Xac/GV5BSgTvb3d1ZoibtnRkrj/8FxZLm7WZbRgP0Ps j/3JjBc3CNQuHg00B92dWQdwm++1CPDbZgFmKbP9x4QoI7CZ47z2vhKtFdriug+3mYCs h/Pp6B9i5VfT80RczQiYo0eprUu3s4Bk0Qg2vdOvVjDagmV0f2+q8o3oAXYpt5jj7YBS RiAw== MIME-Version: 1.0 X-Received: by 10.194.177.132 with SMTP id cq4mr17282245wjc.99.1427291058000; Wed, 25 Mar 2015 06:44:18 -0700 (PDT) Sender: are.you.winning@gmail.com Received: by 10.180.79.73 with HTTP; Wed, 25 Mar 2015 06:44:17 -0700 (PDT) In-Reply-To: <50.00.26446.A7E72155@pb1.pair.com> References: <66c0cca2453de53bed0328af2732c7bd@mail.gmail.com> <50.00.26446.A7E72155@pb1.pair.com> Date: Wed, 25 Mar 2015 13:44:17 +0000 X-Google-Sender-Auth: PY15U5BLqCMlruuaAJwiwwjemrw Message-ID: To: Tony Marston Cc: PHP Internals List Content-Type: multipart/alternative; boundary=089e014942e680d81205121d18c0 Subject: Re: [PHP-DEV] Deprecate or remove mbstring function overloads in PHP 7 From: cw@daverandom.com (Chris Wright) --089e014942e680d81205121d18c0 Content-Type: text/plain; charset=UTF-8 On 25 March 2015 at 09:22, Tony Marston wrote: > "Zeev Suraski" wrote in message news:66c0cca2453de53bed0328af2732c7 > bd@mail.gmail.com... > > >> -----Original Message----- >>> From: Nikita Popov [mailto:nikita.ppv@gmail.com] >>> Sent: Tuesday, March 24, 2015 4:45 AM >>> To: PHP internals >>> Subject: [PHP-DEV] Deprecate or remove mbstring function overloads in PHP >>> 7 >>> >>> Hi internals! >>> >>> The mbstring extension supports replacing PHP string functions with >>> multibyte variants through the mbstring.func_overload ini option. >>> >>> This ini setting is a real PITA for code compatibility, as it makes it >>> impossible >>> to rely on the output of even the most basic PHP functions, like >>> strlen(). >>> Security-critical code in libraries and frameworks typically handles this >>> issue >>> by conditionally using either strlen() or 8bit mb_strlen(). Apart from >>> that, the >>> issue is generally ignored. >>> >>> If we do not wish to drop support for this option in PHP 7, I would at >>> least >>> suggest to deprecate it. >>> >>> Thoughts? >>> >> >> I think we need to understand how it's actually being used before >> discussing >> its deprecation. IIRC it's extremely widely used in Japan, but could be >> wrong. >> I'd want to hear from our Japanese contributors what their thoughts are. >> >> Zeev >> > > I sell my software in several Asian countries, and they regularly use this > ini option. Unless you can point to a fully-supported alternative I am > against dropping this option. > > With the best will in the world, the fully supported alternative is to explicitly use the mbstring functions and handle encodings correctly. For the most part, one could trivially attain identical functionality without falling foul of the deprecation by means of a simple search/replace. The purpose of a change like this would be to remove a wtf factor and encourage people to write more explicit code. Note also that what is being proposed here is merely a deprecation - it won't actually break anything, giving people plenty of time to gracefully migrate their codebases. That said, in the interests of not causing people using this functionality issues with logs full of errors and/or error-related performance issues, I would support having this deprecation set up in such a way that an error is only issued at most once per request - there's no need to issue a deprecation warning at every function call. > -- > Tony Marston > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --089e014942e680d81205121d18c0--