Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:65194 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 23536 invoked from network); 25 Jan 2013 21:39:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Jan 2013 21:39:29 -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.210.178 cause and error) X-PHP-List-Original-Sender: marco@m-s-d.eu X-Host-Fingerprint: 209.85.210.178 mail-ia0-f178.google.com Received: from [209.85.210.178] ([209.85.210.178:52970] helo=mail-ia0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4D/50-17242-09BF2015 for ; Fri, 25 Jan 2013 16:39:29 -0500 Received: by mail-ia0-f178.google.com with SMTP id y26so1314302iab.37 for ; Fri, 25 Jan 2013 13:39:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:x-originating-ip:date:message-id:subject :from:to:content-type:x-gm-message-state; bh=3J5LFkJl5TdgPK4B+q7wKuBgAd/jZ8Sg/cjJZMqA1VE=; b=L0WyhdG3L9yBVqRPYPLpUBlzzRUzFjiFF8TugGdiUJjXumHMyNLnXU0dy/C/tCIcQ/ FvaMNJQamrs9qfPTx4JFIPtbCGOG4Bf8bRuECz0L67dSAtoZCeYG/mp3k8HHpvkksGyr AJYcGUesCQWNs9vk5ajS40XEn8Je0/2udQxjh3gnIWA/sL5iI+q409CRraz1AAeWlVTt W9s47F0KrWB2sCLSTbwlhs0XaQZIOooddPdms21IlPfKal9ihazOeAgMEyTybkSsVphD n/jnmiglV5ScOrIzB19UQcPfUKzWStPHd8KvxyqO/7qmW4nXsslSorclLPCGc2zEsB6N D69A== MIME-Version: 1.0 X-Received: by 10.50.34.193 with SMTP id b1mr5061928igj.89.1359149966191; Fri, 25 Jan 2013 13:39:26 -0800 (PST) Received: by 10.64.78.105 with HTTP; Fri, 25 Jan 2013 13:39:26 -0800 (PST) X-Originating-IP: [84.167.100.253] Date: Fri, 25 Jan 2013 22:39:26 +0100 Message-ID: To: internals Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQkDC9l8qvgvQBurtuAsEDC2Y7k/VJ+P6nx21toCe5EGAcsyM5QoHJLcTxjc0U2dU2xCu+WM Subject: New uint native data type? From: marco@m-s-d.eu (Marco Schuster) Hi all, I'm currently writing a php-program to process certain special binary files, which include 32-bit offsets which I need to read and manipulate. The problem is that PHPs int type is only 31-bit because they have sign information. Sure, I could use the GMP/bcmath stuff, but that isn't really an option because of performance and the fact that I'd have to use bc* functions everywhere, and the code is already complex enough. Because I need to do maths and, later on, file accesses at positions > 2GB, with them and not just print, sprintf("%u",$val) is not sufficient, too. Switching to 64-bit doesn't help in my case, as the program interfaces with external windows-only dependencies and the PHP x64 build doesn't do 64-bit ints at the moment. Would it be possible to extend the PHP engine and add a "uint" native type which allows handling of full 32-bit values and if yes, is there any documentation about the parts of the engine I need to modify? The PHP internals manual doesn't have much content and the Zend / main directories in the source code lack useful information, too. Thanks, Marco