Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:66583 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 31311 invoked from network); 11 Mar 2013 11:42:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Mar 2013 11:42:50 -0000 Authentication-Results: pb1.pair.com header.from=derick@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=derick@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 82.113.146.227 as permitted sender) X-PHP-List-Original-Sender: derick@php.net X-Host-Fingerprint: 82.113.146.227 xdebug.org Linux 2.6 Received: from [82.113.146.227] ([82.113.146.227:45854] helo=xdebug.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 54/E8-09030-833CD315 for ; Mon, 11 Mar 2013 06:42:50 -0500 Received: from localhost (localhost [IPv6:::1]) by xdebug.org (Postfix) with ESMTPS id 7CE39DE13E; Mon, 11 Mar 2013 11:42:45 +0000 (GMT) Date: Mon, 11 Mar 2013 11:42:44 +0000 (GMT) X-X-Sender: derick@whisky.home.derickrethans.nl To: Anatol Belski cc: Gustavo Lopes , internals@lists.php.net In-Reply-To: <00824f21b8abd44ee577bdde7df711d4.squirrel@webmail.klapt.com> Message-ID: References: <1362869409.3221.77.camel@ghost> <00824f21b8abd44ee577bdde7df711d4.squirrel@webmail.klapt.com> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323329-785768408-1363002165=:20747" Subject: Re: [PHP-DEV] Fix for bug #63437 From: derick@php.net (Derick Rethans) --8323329-785768408-1363002165=:20747 Content-Type: TEXT/PLAIN; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE 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=20 > >>> problem. The DatePeriod class has 64-bit integers in its internal=20 > >>> structure. The PHP integer type cannot (in general) represent that=20 > >>> data. So the general method of getting the object data via=20 > >>> get_properties and serializing (and then using __set_state to=20 > >>> convert the array back) does not work unless you represent those=20 > >>> 64-bit integers with some non-integer type and do the conversions. > >> > >> So base64 seems to be only the doubtful point. Thriving to fix=20 > >> that, what if we could bring it in dependency of libgmp to=20 > >> serialize and read as strings (and maybe disable serialization=20 > >> otherwise)? > > > > Why do you need libgmp for that=E2=80=BD > libgmp was just the first shot as it has functions to convert from=20 > arbitrary binary data to string and vice versa, mpz_import and=20 > mpz_export. That's what should work fine across platforms. Looking at=20 > the type definitions here=20 > http://lxr.php.net/xref/PHP_5_5/ext/date/lib/timelib_structs.h#70 i=20 > wouldn't exclude possible platform issues. Implementing that manually=20 > is a tricky job, could be done probably with more homework :) >=20 > What is the way you had in the mind to achieve the string<->integer=20 > conversions? atoll() (or atoq()). cheers, Derick --8323329-785768408-1363002165=:20747--