Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68953 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50086 invoked from network); 7 Sep 2013 17:44:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Sep 2013 17:44:51 -0000 Authentication-Results: pb1.pair.com smtp.mail=marco@m-s-d.eu; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=marco@m-s-d.eu; sender-id=unknown Received-SPF: error (pb1.pair.com: domain m-s-d.eu from 209.85.212.174 cause and error) X-PHP-List-Original-Sender: marco@m-s-d.eu X-Host-Fingerprint: 209.85.212.174 mail-wi0-f174.google.com Received: from [209.85.212.174] ([209.85.212.174:45530] helo=mail-wi0-f174.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 66/2E-00660-1166B225 for ; Sat, 07 Sep 2013 13:44:50 -0400 Received: by mail-wi0-f174.google.com with SMTP id hj3so2020825wib.1 for ; Sat, 07 Sep 2013 10:44:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=uX4uUkeGLb6GIA53/I+C/nyARzV2zaESLR6qlP4nOac=; b=HewFmQE1daqMPPZrDrX+zAydUiX3lNa2TivSDVxwwF8Xkaqh/Pj8jva35FfEMHeNHO RsrxKDR+7GJcKgm1XqV9V8MOW5MFCYHpT7lCaK3n246zlNHBbc/Wxnf2G4T/GVosz26F q3VazBDJKRrg6Q+pEk7JyjLwQ3roskucc5usUtnfDHW6P+xsnQ/2q1RaUmyg+dLjWguh w7vHefPQsrhtW2trp8gD1k1rlOpkXh4WhHsbyfSW1FoN+b+UNn7RGNJ8BP4Qyz6NaH84 6Ux5vSGGPT9jEDEDnxhxbDTFE8YYU+hVVS7Tt3WTshfZz9/qFbmmUvzXn1uEmivrrWG2 6+lQ== X-Gm-Message-State: ALoCoQkUjP5bcGgBT6Nh09mRZLNzWIdvP0zLuUnlJ9UlounSWu2w2MCO22THVX2ZTbe2Q3GNP5wq MIME-Version: 1.0 X-Received: by 10.180.126.3 with SMTP id mu3mr733022wib.27.1378575887335; Sat, 07 Sep 2013 10:44:47 -0700 (PDT) Received: by 10.217.141.72 with HTTP; Sat, 7 Sep 2013 10:44:47 -0700 (PDT) X-Originating-IP: [88.134.199.79] In-Reply-To: References: <52244384.7030407@sugarcrm.com> <5224F352.30408@sugarcrm.com> Date: Sat, 7 Sep 2013 19:44:47 +0200 Message-ID: To: Rasmus Schultz Cc: Stas Malyshev , Matthew Leverton , PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Re: crc32() and ip2long() return values From: marco@m-s-d.eu (Marco Schuster) Hi, I ran into 32-bit problems, too, when working with >2GB files (in this case, raw DVD ISO images) on a 32-bit system (I couldn't find a reliable(!!) way to read a 4-byte absolute offset and seek to it). Of course, this warning is mentioned in the manpage, but really, not having at least a class for unsigned 32-bit ints (e.g. a Uint32 or a Uint64 for 64-bit platforms) which native functions like seek and friends coerce into a 32/64-bit uint makes PHP useless for anything that involves access to files or memory offsets (a problem from another project) > 2GB. From a technical point of view: would such a UInt32 class actually be implementable, and at what cost to BC? Marco On Tue, Sep 3, 2013 at 2:21 AM, Rasmus Schultz wrote: > if I wanted strings or something else, that would be simple enough - > sprintf() will do the job. > > in my case, I needed a scalar value that I can actually persist to the > database. > > On Mon, Sep 2, 2013 at 4:21 PM, Stas Malyshev > wrote: > >> Hi! >> >> > What I'm suggesting is simply a set of alternative functions to >> > ip2long() and crc32() that return consistent values on all platforms, >> > e.g. 32-bit signed integer values - a couple of new functions and a >> > couple of quick updates to the documentation explaining why you might >> > want to use them, that's all. >> >> Why 32-bit signed values and not something else - like binhex or some >> other form? What these values are to be used for? >> >> -- >> Stanislav Malyshev, Software Architect >> SugarCRM: http://www.sugarcrm.com/ >> (408)454-6900 ext. 227 >> >> > > On Mon, Sep 2, 2013 at 4:21 PM, Stas Malyshev wrote: > >> Hi! >> >> > What I'm suggesting is simply a set of alternative functions to >> > ip2long() and crc32() that return consistent values on all platforms, >> > e.g. 32-bit signed integer values - a couple of new functions and a >> > couple of quick updates to the documentation explaining why you might >> > want to use them, that's all. >> >> Why 32-bit signed values and not something else - like binhex or some >> other form? What these values are to be used for? >> >> -- >> Stanislav Malyshev, Software Architect >> SugarCRM: http://www.sugarcrm.com/ >> (408)454-6900 ext. 227 >>