Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:65748 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 21270 invoked from network); 10 Feb 2013 06:32:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Feb 2013 06:32:50 -0000 Authentication-Results: pb1.pair.com header.from=Terry@ellisons.org.uk; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=Terry@ellisons.org.uk; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain ellisons.org.uk from 79.170.44.47 cause and error) X-PHP-List-Original-Sender: Terry@ellisons.org.uk X-Host-Fingerprint: 79.170.44.47 mail47.extendcp.co.uk Received: from [79.170.44.47] ([79.170.44.47:56916] helo=mail47.extendcp.co.uk) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A3/00-20900-11F37115 for ; Sun, 10 Feb 2013 01:32:50 -0500 Received: from host86-184-170-184.range86-184.btcentralplus.com ([86.184.170.184] helo=[192.168.1.91]) by mail47.extendcp.com with esmtpa (Exim 4.80.1) id 1U4QSz-0006r0-1X; Sun, 10 Feb 2013 06:32:45 +0000 Message-ID: <51173F0C.2020403@ellisons.org.uk> Date: Sun, 10 Feb 2013 06:32:44 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 MIME-Version: 1.0 To: Stas Malyshev CC: PHP Internals References: <511666DE.8080809@fedoraproject.org> <5116D57F.6030802@ellisons.org.uk> <5117131B.2040606@sugarcrm.com> In-Reply-To: <5117131B.2040606@sugarcrm.com> Content-Type: multipart/alternative; boundary="------------050400010605050506070809" X-Authenticated-As: Terry@ellisons.org.uk Subject: Re: [PHP-DEV] double val to long val conversion issue From: Terry@ellisons.org.uk (Terry Ellison) --------------050400010605050506070809 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 10/02/13 03:25, Stas Malyshev wrote: > >> these onto the appropriate visualC / gcc types. As far as I can see, >> PHP doesn't and seems to use long and int almost interchangeably which > PHP indeed does not use fixed-size types in zvals, etc. but it > definitely does not "use long and int almost interchangeably". In almost > any place where int is used instead of long or vice versa (unless it is > a specific small value that is nowhere near limits of either int or long > and used in very restricted context) - it is a bug and should be fixed. > If you know of such places, please name them or even better, submit a > bug report pointing them out. Stan, you are right to correct me. Sorry. However, I still feel that the implicit assumption is that sizeof(long) == 2*sizeof(int) and this isn't the case with visualC, and PHP internal data structures compiled with visualC and gcc are significantly different; for example hash keys are 32 bits long on Windows and 64bits on *nix. Why aren't they 32bits, say, on both? (as there is no performance benefit is having 64bit hash keys when the maximum size of a hash table is an int). --------------050400010605050506070809--