Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:66599 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45093 invoked from network); 13 Mar 2013 09:06:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Mar 2013 09:06:17 -0000 Authentication-Results: pb1.pair.com header.from=ab@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=ab@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 85.214.73.107 as permitted sender) X-PHP-List-Original-Sender: ab@php.net X-Host-Fingerprint: 85.214.73.107 klapt.com Received: from [85.214.73.107] ([85.214.73.107:58663] helo=h1123647.serverkompetenz.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 90/C2-13132-68140415 for ; Wed, 13 Mar 2013 04:06:17 -0500 Received: by h1123647.serverkompetenz.net (Postfix, from userid 1006) id 101C1714026; Wed, 13 Mar 2013 10:06:10 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on h1123647.serverkompetenz.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=3.5 tests=ALL_TRUSTED,BAYES_00 autolearn=unavailable version=3.3.1 Received: from [192.168.178.7] (dslb-094-216-054-106.pools.arcor-ip.net [94.216.54.106]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by h1123647.serverkompetenz.net (Postfix) with ESMTPSA id 82E866FCBEC; Wed, 13 Mar 2013 10:06:08 +0100 (CET) To: Derick Rethans Cc: Gustavo Lopes , internals@lists.php.net In-Reply-To: References: <1362869409.3221.77.camel@ghost> <00824f21b8abd44ee577bdde7df711d4.squirrel@webmail.klapt.com> Content-Type: text/plain; charset="UTF-8" Date: Wed, 13 Mar 2013 10:06:06 +0100 Message-ID: <1363165566.3221.79.camel@ghost> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] Fix for bug #63437 From: ab@php.net (Anatol Belski) On Mon, 2013-03-11 at 11:42 +0000, Derick Rethans wrote: > Please, no top posting! > > On Mon, 11 Mar 2013, Anatol Belski wrote: > > On Sun, March 10, 2013 23:11, Derick Rethans wrote: > > > On Sat, 9 Mar 2013, Anatol Belski wrote: > > > > > >> On Sat, 2013-03-09 at 21:57 +0100, Gustavo Lopes wrote: > > >> > > >>> I would agree in principle, but, as I explained before, there is a > > >>> problem. The DatePeriod class has 64-bit integers in its internal > > >>> structure. The PHP integer type cannot (in general) represent that > > >>> data. So the general method of getting the object data via > > >>> get_properties and serializing (and then using __set_state to > > >>> convert the array back) does not work unless you represent those > > >>> 64-bit integers with some non-integer type and do the conversions. > > >> > > >> So base64 seems to be only the doubtful point. Thriving to fix > > >> that, what if we could bring it in dependency of libgmp to > > >> serialize and read as strings (and maybe disable serialization > > >> otherwise)? > > > > > > Why do you need libgmp for that‽ > > > libgmp was just the first shot as it has functions to convert from > > arbitrary binary data to string and vice versa, mpz_import and > > mpz_export. That's what should work fine across platforms. Looking at > > the type definitions here > > http://lxr.php.net/xref/PHP_5_5/ext/date/lib/timelib_structs.h#70 i > > wouldn't exclude possible platform issues. Implementing that manually > > is a tricky job, could be done probably with more homework :) > > > > What is the way you had in the mind to achieve the string<->integer > > conversions? > > atoll() (or atoq()). Please take a look at the reworked patch in #53437 https://bugs.php.net/patch-display.php?bug_id=53437&patch=date_patch_var3.patch&revision=latest Serializing 64 bit integers as strings. Regards Anatol > > cheers, > Derick > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php