Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:64429 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 55731 invoked from network); 24 Dec 2012 19:05:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Dec 2012 19:05:24 -0000 Authentication-Results: pb1.pair.com header.from=glopes@nebm.ist.utl.pt; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=glopes@nebm.ist.utl.pt; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain nebm.ist.utl.pt from 193.136.128.22 cause and error) X-PHP-List-Original-Sender: glopes@nebm.ist.utl.pt X-Host-Fingerprint: 193.136.128.22 smtp2.ist.utl.pt Linux 2.6 Received: from [193.136.128.22] ([193.136.128.22:47224] helo=smtp2.ist.utl.pt) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C6/32-34516-C67A8D05 for ; Mon, 24 Dec 2012 14:05:23 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp2.ist.utl.pt (Postfix) with ESMTP id 961E470003ED; Mon, 24 Dec 2012 19:05:13 +0000 (WET) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at ist.utl.pt Received: from smtp2.ist.utl.pt ([127.0.0.1]) by localhost (smtp2.ist.utl.pt [127.0.0.1]) (amavisd-new, port 10025) with LMTP id yt0Bza7LpuwX; Mon, 24 Dec 2012 19:05:13 +0000 (WET) Received: from mail2.ist.utl.pt (mail.ist.utl.pt [IPv6:2001:690:2100:1::8]) by smtp2.ist.utl.pt (Postfix) with ESMTP id B725B70003E0; Mon, 24 Dec 2012 19:05:12 +0000 (WET) Received: from cataphract.cata.lo.geleia.net (a81-84-77-119.cpe.netcabo.pt [81.84.77.119]) (Authenticated sender: ist155741) by mail2.ist.utl.pt (Postfix) with ESMTPSA id A49F920084A7; Mon, 24 Dec 2012 19:05:12 +0000 (WET) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Sherif Ramadan" , "Anthony Ferrara" Cc: "Igor Wiedler" , "PHP Internals" References: <7EF0DC28-1C66-4767-BF78-96F94BC28620@wiedler.ch> Date: Mon, 24 Dec 2012 18:58:38 -0000 MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable Organization: =?utf-8?Q?N=C3=BAcleo_de_Eng=2E_Biom=C3=A9di?= =?utf-8?Q?ca_do_IST?= Message-ID: In-Reply-To: User-Agent: Opera Mail/12.00 (Win32) Subject: Re: [PHP-DEV] PHP-5.5 unpack change broke pecl/pear From: glopes@nebm.ist.utl.pt ("Gustavo Lopes") On Mon, 24 Dec 2012 12:13:35 -0000, Anthony Ferrara = wrote: > You're right. It does break BC, but this was a bug fix. >> https://bugs.php.net/bug.php?id=3D61038 >> >> The behavior is incorrect in that regard. > > However in this case that *bug* does have fairly significant BC > implications. > > In fact, how I read the specification is that the original binary form= at = > is NULL padded, not the resulting string. Therefore, you could make th= e > argument that the new behavior is wrong. The Perl docs say: > =C2=B4A=C2=B4 strips trailing whitespace and nulls, =C2=B4Z=C2=B4 stri= ps everything after = > the first null, and =C2=B4a=C2=B4 returns data with no stripping at al= l. PHP docs are silent on this matter. Yes, PHP does not have to follow Perl's specification, but 1) PHP's pack/unpack was clearly modeled after Perl 2) is desirable to have close semantics to Perl's implementation as it = benefits those who use both languages like the submitter of #61038 Given 1), perl's docs and implementation and the absence of evidence to = = the contrary (like PHP tests and documentation), it's clear to me that = pre-5.5 behavior is a bug (no quotes). Now you may think that the cost of fixing this bug does not cover its = benefits, possibly given alternative solutions. What I can say about that is that I think that the alternative solution = = that you propose (switching the behavior of "a" and "Z") would be tradin= g = a relatively minor short term inconvenience (this will affect several = orders of magnitude less people than the htmlentities() change in 5.4) f= or = one that will exist indefinitely and I consider that a poor choice. -- = Gustavo Lopes