Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:57455 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 71128 invoked from network); 20 Jan 2012 07:25:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Jan 2012 07:25:27 -0000 Authentication-Results: pb1.pair.com smtp.mail=ezyang@mit.edu; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ezyang@MIT.EDU; sender-id=pass Received-SPF: pass (pb1.pair.com: domain mit.edu designates 18.9.25.13 as permitted sender) X-PHP-List-Original-Sender: ezyang@mit.edu X-Host-Fingerprint: 18.9.25.13 DMZ-MAILSEC-SCANNER-2.MIT.EDU Linux 2.6 Received: from [18.9.25.13] ([18.9.25.13:44869] helo=dmz-mailsec-scanner-2.mit.edu) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FB/D4-42843-6E6191F4 for ; Fri, 20 Jan 2012 02:25:27 -0500 X-AuditID: 1209190d-b7fbf6d0000008ba-3d-4f1916e387a0 Received: from mailhub-auth-1.mit.edu ( [18.9.21.35]) by dmz-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP id 35.E9.02234.3E6191F4; Fri, 20 Jan 2012 02:25:23 -0500 (EST) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id q0K7PN2L028119; Fri, 20 Jan 2012 02:25:23 -0500 Received: from localhost (EZYANG.MIT.EDU [18.243.1.50]) (authenticated bits=0) (User authenticated as ezyang@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q0K7PMcG006095; Fri, 20 Jan 2012 02:25:22 -0500 (EST) Content-Type: text/plain; charset=UTF-8 To: Pierre Joye , "Edward Z. Yang" , internals In-reply-to: <1326039782-sup-7389@ezyang> References: <1325788652-sup-3243@ezyang> <1326039782-sup-7389@ezyang> Date: Fri, 20 Jan 2012 02:25:21 -0500 Message-ID: <1327044256-sup-8840@ezyang> User-Agent: Sup/git Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrEIsWRmVeSWpSXmKPExsUixCmqrPtYTNLf4P5OdYsDr7qZLQ683cZm sXZ9N4sDs8fOWXfZPZ6sW8Pi0dL0jymAOYrLJiU1J7MstUjfLoEr482GE4wFB2UrWo+tYGpg /CfWxcjBISFgIvFiSmIXIyeQKSZx4d56NhBbSGAfo8SlhSFdjFxA9gZGidONsxkhnM+MEgd+ b2UBaWYWUJdYP08IpEFYQEfi7qarTCA2G1D40bGnrCC2iEC5xPyFzWwg5ZwCmhJHHhhCjOli lNhz/Dw7SA2LgKrE7mMTwRbzCmhIvL/8CcwWFRCWeHKkmRnEZhaQl2jeOpt5AiP/LITNs5Bk FjAyrWKUTcmt0s1NzMwpTk3WLU5OzMtLLdI10svNLNFLTSndxAgOQ0neHYzvDiodYhTgYFTi 4U10l/AXYk0sK67MPcQoycGkJMqbKCTpL8SXlJ9SmZFYnBFfVJqTWnyIUYKDWUmE1+EJUDlv SmJlVWpRPkxKmoNFSZxXVeudn5BAemJJanZqakFqEUxWnYNDYOXH1axSLHn5ealKErzpwCgU EixKTU+tSMvMKUGoZOLgBNnDA7RHGKSGt7ggMbc4Mx0if4pRl+Nfa/t5RiGwQVLivLYgRQIg RRmleXBzYEnlFaM40IfCvGIgVTzAhAQ36RXQEiagJR5NYiBLShIRUlINjOujHtyP0RZ6wih+ vc2G/YboqU/ai//tbOs+WbL9mkyThcffgyLzLI1e8tX7bL4SPF/7ekn676Aki2dvLl4Je7jE cNnT/1scT706sOF7otmL/xuX2bx8UX2520F9SWe7Y0cMr3jSVAbDjLXZknJXe0sSPzFLRprP z0vX2LH2zR6pCdGPlqx+7qbEUpyRaKjFXFScCACC7HX1BQMAAA== Subject: Re: [PHP-DEV] Bug 48417 and PHP 5.4 From: ezyang@MIT.EDU ("Edward Z. Yang") Hey Pierre, I was wondering if you'd be willing to pitch a rollback of r300894 post-code-freeze. If not, I'll start writing error detection code to accomodate for PHP 5.4 :^) Thanks, Edward Excerpts from Edward Z. Yang's message of Sun Jan 08 11:41:50 -0500 2012: > Hello Pierre, > > The whole situation is a slightly complicated. One question to ask is: "Is > there code in PHP 5.3 that worked, which now no longer works in PHP 5.4?" The > answer to this question is *yes*, as seen by this example: > > var_dump(iconv("UTF-8", "ISO-8859-1//IGNORE", "\xE4\xB8\xAD")); > > Now, the reason why this worked in PHP 5.3 was because of a "bug", namely > #52211, so the situation in PHP 5.3 was "two wrongs make a right" (except, > of course, in the case where more than 8000 bytes are involved.) Fixing one > of the bugs causes "//IGNORE" to stop working entirely. So if you ask > another question, "Are there less bugs in PHP 5.4 than in PHP 5.3", the answer > is also yes. > > Now, consider the perspective of a library developer using iconv //IGNORE. In > PHP 5.3, effective workarounds exist: I can fix #52211 by checking for captured > errors and returning false instead, I can fix #48147 by splitting my input into > 8kb chunks (mumble utf-8 boundaries) and feeding it to iconv individually. > > In PHP 5.4, I am left with no such redress. Because iconv will now always > return false upon an input, regardless of whether or not //IGNORE is set, > I can no longer do conversions with invalid inputs. It's worth repeating: > #48147 is no longer "iconv with //IGNORE cuts string", it's "iconv with > //IGNORE doesn't work". At all. I *guarantee* you large amounts of PHP code > will be affected. > > It seems it would be better to wait for a complete fix, than to fix it partially > and leave some (widely used) functionality completely broken. > > Is this a bug in glibc? I sincerely hope I can convince Ulrich Drepper > so, since I agree that his API is completely off the wall: > > http://sources.redhat.com/bugzilla/show_bug.cgi?id=13541 > > But as it stands, Ulrich does not seem to believe that there is any bug (see > that he's closed both of my upstream bugs; and, since //IGNORE is wholly > undocumented, there is not really any spec I can hold him to), so it would seem > most advisable for PHP to play nice, since most users are not in the position > to patch their glibc installation. > > Cheers, > Edward > > Excerpts from Pierre Joye's message of Sun Jan 08 07:36:03 -0500 2012: > > hi, > > > > I closed one bug (unrelated to what you have) and added a comment to > > the /ignore issue. I do not see a bug in PHP but if you have any info > > that shows that PHP causes this problem, then please add them to the > > bug so we can fix it, if not I will bogus it as there is no bug in php > > but in iconv (glibc or other implementations). > > > > On Thu, Jan 5, 2012 at 7:42 PM, Edward Z. Yang wrote: > > > Hello all, > > > > > > I know it seems like there always is infinite pile of work to do before > > > the PHP 5.4 release comes out, but I think this bug is worth looking at. > > > > > > https://bugs.php.net/bug.php?id=52211 > > > > > > I suggest reverting r300894, since this causes //IGNORE to stop working. > > > Preserving functionality should probably be more important. > > > > > > The underlying cause of this bug is this one: > > > > > > https://bugs.php.net/bug.php?id=48147 > > > > > > But I don't think this feature is going to get implemented in time. > > > > > > Edward > > > > > > -- > > > PHP Internals - PHP Runtime Development Mailing List > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > >