Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53244 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40795 invoked from network); 10 Jun 2011 14:54:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Jun 2011 14:54:59 -0000 Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.170 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.216.170 mail-qy0-f170.google.com Received: from [209.85.216.170] ([209.85.216.170:35702] helo=mail-qy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0F/CA-54720-04032FD4 for ; Fri, 10 Jun 2011 10:54:57 -0400 Received: by qyk32 with SMTP id 32so3604855qyk.8 for ; Fri, 10 Jun 2011 07:54:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=D++wyN+AJNhAuaR1+y8GnWEBwtymPCJ9Tf9SO1uMAW0=; b=OW3PMhXCNm5jlV4Iy/d4hgM/2Mt8DrMFLGsm1Yt+6OrsMT2ALmrwaX9lBCDNKGwt42 nrBN6ap9rZ+ghhciTh5wbWy4KumlscnCjhkCRCDojVpHvcfNr/uCgozMOQ3gZYA5p5Ly MRZTw8W0zgcdjyNSeNc5eQZibYk9ENgoOnLSQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=T2Oh+3OK1TjR8Icu2ctkPMiYLAkJu87NyTD2bIqAL1uCXU6+2fsgQUMoDKFGYcmHnG TupHiK1gZeqqPZDP1IXpmgCkRN/qVsxywXCHGynX2jUhTZ6GoeixU7KjOf7hpfhkWrxJ Vp74ehEvx6ikEQPfLYGn5Kn2ehaX+3+zrJgrU= MIME-Version: 1.0 Received: by 10.150.193.17 with SMTP id q17mr3205902ybf.189.1307717694582; Fri, 10 Jun 2011 07:54:54 -0700 (PDT) Received: by 10.147.168.18 with HTTP; Fri, 10 Jun 2011 07:54:54 -0700 (PDT) In-Reply-To: References: Date: Fri, 10 Jun 2011 16:54:54 +0200 Message-ID: To: Derick Rethans Cc: Hannes Landeholm , PHP Developers Mailing List Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] 32 bit / 64 bit integer confusion From: pierre.php@gmail.com (Pierre Joye) hi, On Fri, Jun 10, 2011 at 4:47 PM, Derick Rethans wrote: > On Fri, 10 Jun 2011, Hannes Landeholm wrote: > >> 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. > > I agree that that should be the same. But sadly, Windows uses a > different integer size model than almost everything else modern. > Where Linux and Mac and other unices use 8 bytes for an "int", Windows > uses 4 bytes (http://en.wikipedia.org/wiki/LP64#Specific_C-language_data_models). > Because PHP internally uses "int" for its integer type, on Windows > that's still only 32 bit. The sad part is not that windows uses a consistent type size across architecture but that linux and gcc considers that a type could be whatever the architecture uses. Hence why stdint.h was introduced and should be used instead of the long/int. > But yes, it would be awesome if PHP actually took care of this and uses > 64 bit ints on 64 bit processors. A type should be the same on all architecture, even more at the PHP script level. Cheers, -- Pierre @pierrejoye | http://blog.thepimp.net | http://www.libgd.org