Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67675 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 83008 invoked from network); 10 Jun 2013 12:04:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Jun 2013 12:04:43 -0000 Authentication-Results: pb1.pair.com smtp.mail=ekneuss@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ekneuss@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.128.53 as permitted sender) X-PHP-List-Original-Sender: ekneuss@gmail.com X-Host-Fingerprint: 209.85.128.53 mail-qe0-f53.google.com Received: from [209.85.128.53] ([209.85.128.53:51174] helo=mail-qe0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9A/6B-30264-AD0C5B15 for ; Mon, 10 Jun 2013 08:04:43 -0400 Received: by mail-qe0-f53.google.com with SMTP id 1so3936894qee.26 for ; Mon, 10 Jun 2013 05:04:40 -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:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=XQYWGalXOQ2XqOU8jcHx942ThwdhTP+w8zmyytfTTyU=; b=HCkzCJwt1kur1x6HKmYFF5QhUkxVg/HFy05pWokyG30Sfu8u98S2f+wIBBfBrdQG5l i/FozRiPxA1eytx0kCL9UHD+yFFVb6+27To5+81TLh0411i9+4deuVjlAXheppkKJ1Sr 78vpdlaK4s2rugjO8imw5e4BO2gcQj7JAIZfTKci3yVn6XGeM9+rDZRimZWyzY6ostrZ Hy6mNQ9NlaG1qCUpZCQvbD0aClq1YCBP38vUVF3IeuNEMDiRtoHC4bKow40IOQqBJYwp Ivay4qwspuGW/OioEDIKk8+8kZ3JHAvf7xTvf6WLtiMN1e+/w0Lm+OpZjlmsFIKhKvEa MXPA== X-Received: by 10.224.39.77 with SMTP id f13mr13285862qae.96.1370865879960; Mon, 10 Jun 2013 05:04:39 -0700 (PDT) MIME-Version: 1.0 Sender: ekneuss@gmail.com Received: by 10.49.108.66 with HTTP; Mon, 10 Jun 2013 05:04:19 -0700 (PDT) In-Reply-To: References: <6dd0f0c5be06dc0713890f2000a0b551.squirrel@webmail.klapt.com> Date: Mon, 10 Jun 2013 14:04:19 +0200 X-Google-Sender-Auth: x7KfszAGIOnk5vawNObaZaFS4qg Message-ID: To: Anatol Belski Cc: Gustavo Lopes , Derick Rethans , =?UTF-8?Q?Johannes_Schl=C3=BCter?= , Stas Malyshev , PHP internals Content-Type: multipart/alternative; boundary=20cf3074d926cf750b04decb956d Subject: Re: [PHP-DEV] Re: #53437 From: colder@php.net (Etienne Kneuss) --20cf3074d926cf750b04decb956d Content-Type: text/plain; charset=UTF-8 On Mon, Jun 10, 2013 at 1:56 PM, Anatol Belski wrote: > Hi Etienne, > > On Mon, June 10, 2013 13:24, Etienne Kneuss wrote: > > On Fri, Jun 7, 2013 at 9:27 PM, Gustavo Lopes > > wrote: > > > > > >> On Fri, 07 Jun 2013 14:06:11 +0200, Derick Rethans > >> wrote: > >> > >> > >> That's the one where conversion int <> string for serialization was > >> > >>>> developed. It came into 5.5 with this patches (the originally > >>>> proposed patch is still attached to that ticket) > >>>> > >>>> http://git.php.net/?p=php-src.**git;a=commitdiff;h=** > >>>> 0ee71557ffd285552659b6aa37ea23**6e3bad493f >>>> -src.git;a=commitdiff;h=0ee71557ffd285552659b6aa37ea236e3bad493f> > >>>> > >>>> > >>> > >>> ["days"]=> > >>> - int(3) > >>> + string(1) "3" > >>> > >>> > >>> and > >>> > >>> - 'days' => 0, > >>> + 'days' => '0', > >>> > >>> > >>> I see this in all test cases - this is a BC break. > >>> > >>> > >> > >> I don't think this is a BC break, or at least it's a very minor. As I > >> understand it, when you read the property directly you still get an int: > >> > >> > >> $iv = "2008-05-11T15:30:00Z/2007-03-**01T13:00:00Z"; > >> $di = new DateInterval($iv); > >> var_dump($di->days); //int(437) > >> > >> So this applies only to var_dump() output, serialization output and > >> something exotic as an array cast (which anyway has its own > >> peculiarities wrt the key type conversion -- or the absence of it). > >> > >> > > So if I understand correctly var_dump now indicates a different type than > > what accessing the property returns? > > > > Even if the change itself does not constitute a big BC break, this > > behavior is confusing and seems like a big no-no to me. > > > > As I mentioned previously, that small piece is easy fixable, though it > possibly makes that place not portable between 32 and 64 bit. This is the case for most string<->int conversions, isn't it? > The main > intention is to fix the unserialization crash, which IMHO interleaves this > small deviation. > Sure, I understand the intention. It's even more a new feature than a bug-fix at this point (as there are other ways to prevent this without actually implementing serialization). We shouldn't make the output of var_dump less consistent for something that feels as remote as serialization/unserialization, and especially if it is easily fixable. Best, -- Etienne Kneuss --20cf3074d926cf750b04decb956d--