Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53239 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 23172 invoked from network); 10 Jun 2011 12:55:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Jun 2011 12:55:23 -0000 Authentication-Results: pb1.pair.com smtp.mail=landeholm@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=landeholm@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.170 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: landeholm@gmail.com X-Host-Fingerprint: 209.85.214.170 mail-iw0-f170.google.com Received: from [209.85.214.170] ([209.85.214.170:55585] helo=mail-iw0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8B/78-54720-A3412FD4 for ; Fri, 10 Jun 2011 08:55:22 -0400 Received: by iwn3 with SMTP id 3so2610676iwn.29 for ; Fri, 10 Jun 2011 05:55:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=3V3iBXpCWicJCFADOueJOqlf9T4dbgCHsVegExOEjO0=; b=yGZPn2nRD/+fdrVyWgnVXZ9mVrhmCulJrC0eSg3BE+MQv7wvfyrbhS4/RxgMADE/Iq HIaLvE/ECU5yhFffxKgZYRdC74cpWkCOljT0PC4bmTkZqIOj5laFAZe3/NWNa5ff874O L1VKBHL5bgiVSwnxEXrhkQ3qD40Sr5r3FC0qg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=Q0jjKHeFgukUV9z7NcGQ2sjCKKIgu2bxvG7k327H9D1OBWIJwQ71Q1ybwmvq7EblAF FFPZ59vfvTWL3h6BwOEI5PkPjnqLJrXS2MYesGGECn7vIMZEHDKMT7RxwfYtP1ahfamM 5pEkxB32EjmkL9SkzaLH6w53oXcKOn0jvBCUo= MIME-Version: 1.0 Received: by 10.42.28.3 with SMTP id l3mr2673031icc.256.1307710519574; Fri, 10 Jun 2011 05:55:19 -0700 (PDT) Received: by 10.231.33.66 with HTTP; Fri, 10 Jun 2011 05:55:19 -0700 (PDT) Date: Fri, 10 Jun 2011 14:55:19 +0200 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary=20cf301d426efd027f04a55b14cc Subject: 32 bit / 64 bit integer confusion From: landeholm@gmail.com (Hannes Landeholm) --20cf301d426efd027f04a55b14cc Content-Type: text/plain; charset=ISO-8859-1 Greetings. One very important feature of PHP is its interoperability. This allows my colleagues to work in both Windows, Ubuntu and OSX - developing the same application. Details like the fact that PHP will replace forward slash with backward slash automatically in windows is a great example of that. As a developer it's very important for me that the code executes exactly the same - no matter if the script is running on my development machine or in the production server. This is true for many other scripted languages. In javascript for example I expect an integer addition to return the same result - no matter the platform. At this point PHP is currently problematic since it for some reason - defines the integer size to depend on the current platform the code is running on which make no sense at all in my eyes. What are the reasoning behind this? I think the PHP integer size should be changed to always be 64 bit - independent of the platform. I have stumbled on this annoying inconsistency several times the last month. One specific use case for me where this causes problems is that I have integer ID columns in my database. I fully expect those to overflow above 2.1 billion at some point so then I suddenly have to be concerned if PHP is 32 or 64 bit compiled. Also, telling developers that "an integer always supports 64 bit" will make life much easier for them when they need it for implementing large numbers in cryptography, date arithmetics, scientific values, API interaction, etc etc. ~Hannes --20cf301d426efd027f04a55b14cc--