Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:71245 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 27202 invoked from network); 18 Jan 2014 15:02:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Jan 2014 15:02:21 -0000 Authentication-Results: pb1.pair.com header.from=anthonyryan1@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=anthonyryan1@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.128.171 as permitted sender) X-PHP-List-Original-Sender: anthonyryan1@gmail.com X-Host-Fingerprint: 209.85.128.171 mail-ve0-f171.google.com Received: from [209.85.128.171] ([209.85.128.171:63029] helo=mail-ve0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 57/10-25218-C779AD25 for ; Sat, 18 Jan 2014 10:02:20 -0500 Received: by mail-ve0-f171.google.com with SMTP id pa12so85362veb.2 for ; Sat, 18 Jan 2014 07:02:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=MWTwaqG1Tf7QMZUbgvz7/F7bJLXAGQEXVQ/BupjJCAw=; b=XRSz/dtUes7FKS1Jz+RXvtiKWLF0YGeJL2QDVnTsfrMJGU1PZgn8MpGdfKfpxewwzz QGQhb7+ov/bzGAsCWbfo1nK/RG2TTkKg4NYXC7FvY//hADyAoHRJHuBX4LwZrHUJNxBE FF1cNIR+cRDnsldFkvZO8peqksaoJxFslugKIUdz8mE5oRCADZx8OEm3RpRKpYlP2oDJ jQGFniUj1OmT/l9Of9gEtk0X7p9tgbP6IfT27tMWIkGqkc2wyxt6JYGJWFit/s6LdGU5 oS6VD6FvcSZyAzbX4kPiLQHE6tl1HG10xUbXiDfX0jnpCNfwNQtiDFGlQCEzH8JITluZ yzjw== X-Received: by 10.52.251.68 with SMTP id zi4mr1962554vdc.25.1390057337793; Sat, 18 Jan 2014 07:02:17 -0800 (PST) MIME-Version: 1.0 Received: by 10.58.242.99 with HTTP; Sat, 18 Jan 2014 07:01:37 -0800 (PST) Date: Sat, 18 Jan 2014 10:01:37 -0500 Message-ID: To: internals@lists.php.net Content-Type: text/plain; charset=UTF-8 Subject: XMLRPC and 64bit integers From: anthonyryan1@gmail.com (Anthony Ryan) The xmlrpc extension currently fails to handle 64bit integers[1], and the resolutions all seem suboptimal. XML-RPC is over 15 years old, and the initial specification omitted support for 64bit integers. Today however, XML-RPC implementations frequently need to exchange 64bit integers. A de facto standard, the integer has been gaining traction in libraries for several years now. In the interest of improving compatibility with these libraries, I created a pull request[2] adding support for decoding with the xmlrpc extension. In the process of doing this however I realized that I had introduced a problem with xmlrpc encoding. Firstly, I allowed xmlrpc to output a 64bit integer, which was both a spec violation ( can only contain a 32bit integer) and caused a test verifying this limitation to fail[3]. This leads me to a series of possible solutions, none of which are good: 1. We can break the spec, and put 64bit integers into , but this is wrong according to the spec and may break some implementations. 2. We could output in place of which breaks backwards compatibility and possibly compatibility with older implementations of XML-RPC. 3. We could create an opt-in 64bit mode, but people should not need to opt-in to bug fixes (it sets a bad precedent). 4. We could check the size of every individual integer and output only when exceeding a 32bit integer, but this adds complexity to the actual encoding process. 5. We could allow the decoding of 64bit integers but not allow encoding. This then introduces an inconsistency between encoding and decoding. I would appreciate feedback on how people would like to see this issue resolved. [1] https://bugs.php.net/bug.php?id=66389 [2] https://github.com/php/php-src/pull/555 [3] https://github.com/php/php-src/blob/master/ext/xmlrpc/tests/bug40576_64bit.phpt#L36