Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:74387 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15985 invoked from network); 20 May 2014 20:46:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 May 2014 20:46:29 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.181 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.217.181 mail-lb0-f181.google.com Received: from [209.85.217.181] ([209.85.217.181:61341] helo=mail-lb0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9E/21-08771-32FBB735 for ; Tue, 20 May 2014 16:46:28 -0400 Received: by mail-lb0-f181.google.com with SMTP id q8so848025lbi.26 for ; Tue, 20 May 2014 13:46:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=OuZFXnnurQQE4Yd+4HcKIbT/5PtYOLSGx9Zz8MoSrYU=; b=HxQBwJF62o6PQ8E91nrM76SVYnTUo8zVDe3Nf1jgVAVrSRt5yCGs2/5hpLA6wniCrv ByUDZhNYU5xTRaI/UHcIGiMg/LNMOjvrhMZYvXNYXGg3KNM1Gg5cC/MLXSlH+PNxel6k ohe1pplNwlQiWgIrhEIvyfK6fPierhi8VPncwbtI1rYnZXKA5fgLWsZM4Loq02PkfbWc Fq8VlPEO9LD0MqoMt8Mk4Hkpc3jIPlcGhUIpH/m45m5x9LQMVpEKX9Q5NEY6+VhL1SUP u+5I4n11yVAIyywgAWGgWXgrjqkKLe3hGB/u7IhO1DtoymJf26rRmzy9K0kAC6NUyciQ 6J6w== X-Received: by 10.152.203.203 with SMTP id ks11mr3172279lac.88.1400618783941; Tue, 20 May 2014 13:46:23 -0700 (PDT) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.205.73 with HTTP; Tue, 20 May 2014 13:45:43 -0700 (PDT) In-Reply-To: References: Date: Wed, 21 May 2014 05:45:43 +0900 X-Google-Sender-Auth: mhp9ULpJGeJhiQ67zvj0QGqNWyQ Message-ID: To: Nikita Popov Cc: Arvids Godjuks , PHP internals Content-Type: multipart/alternative; boundary=001a113470c0152a3a04f9daf935 Subject: Re: [PHP-DEV] Re: 64bit and phpng, votes and plans From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a113470c0152a3a04f9daf935 Content-Type: text/plain; charset=UTF-8 Hi Nikita, On Tue, May 20, 2014 at 4:09 PM, Nikita Popov wrote: > You can already use a key larger than 32 bits to index an array. The > limitation only applies if you want to actually store more than 2^32 (or > 2^31 depending on the exact implementation) elements. That's the beauty of > a hashtable: The allowed key domain is totally independent of the hashtable > size ;) > Right and wrong. When key is string, key can be anything. However, when it is int, it's not. $ php -r '$arr[9999999999999999999999999999999]="abc";var_dump($arr);' array(1) { [-4571153621781053440]=> string(3) "abc" } $ php -r '$arr["9999999999999999999999999999999"]="abc";var_dump($arr);' array(1) { ["9999999999999999999999999999999"]=> string(3) "abc" } This is the reason why convert DB data values and Web inputs should not be converted to native PHP data type blindly :) It could work, but it cannot with 64bit int. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a113470c0152a3a04f9daf935--