Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76261 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 82342 invoked from network); 30 Jul 2014 05:48:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Jul 2014 05:48:17 -0000 Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 192.64.116.200 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.200 imap1-2.ox.privateemail.com Received: from [192.64.116.200] ([192.64.116.200:38823] helo=imap1-2.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E7/17-29261-F1788D35 for ; Wed, 30 Jul 2014 01:48:17 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 65326B00087; Wed, 30 Jul 2014 01:48:28 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at imap1.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap1.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id SXiRGc-uNKxL; Wed, 30 Jul 2014 01:48:28 -0400 (EDT) Received: from app2.ox.registrar-servers.com (app2.ox.registrar-servers.com [198.187.29.232]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 75061B0007B; Wed, 30 Jul 2014 01:48:27 -0400 (EDT) Date: Wed, 30 Jul 2014 06:48:27 +0100 (BST) Reply-To: Andrea Faulds To: tjerk.meesters@gmail.com, yohgaki@ohgaki.net Cc: internals@lists.php.net Message-ID: <633025718.351649.1406699307462.open-xchange@app2.ox.registrar-servers.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Medium X-Mailer: Open-Xchange Mailer v7.4.2-Rev29 Subject: Re: [PHP-DEV] signed long hash index for PHP7? From: ajf@ajf.me (Andrea Faulds) > On July 30, 2014 at 6:01 AM Tjerk Meesters wrote: > > > Instead of doing that, why not simply disallow negative array indices to be > used as integers? > > In other words, negative indices are treated as if you had used strings so > that it doesn't upset the the last numeric index kept in the array > structure. > > From what I can tell, it should be a pretty simply patch. > > Thoughts? That would make sense, but doesn't solve all edge cases as your maximum array index is still more than 2 times the largest positive integer on 32-bit. Perhaps we should completely change behaviour and forbid negative indices and store indexes that are too large as strings? That would be the sanest way to go IMO, solves all the edge cases, and makes ["999999999999999999999999999"] and [999999999999999999999999999] consistent, resolving that long-existing discrepancy. -- Andrea Faulds