Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76260 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 77671 invoked from network); 30 Jul 2014 05:00:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Jul 2014 05:00:55 -0000 Authentication-Results: pb1.pair.com header.from=tjerk.meesters@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=tjerk.meesters@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.178 as permitted sender) X-PHP-List-Original-Sender: tjerk.meesters@gmail.com X-Host-Fingerprint: 209.85.212.178 mail-wi0-f178.google.com Received: from [209.85.212.178] ([209.85.212.178:34665] helo=mail-wi0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7C/86-29261-50C78D35 for ; Wed, 30 Jul 2014 01:00:54 -0400 Received: by mail-wi0-f178.google.com with SMTP id hi2so1628421wib.11 for ; Tue, 29 Jul 2014 22:01:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=fDhLHuHL8NNLpN7f9aF/PR+9m1TjrXDrRWsTYG5Xf/A=; b=DY/b1LZsREEDsp7T9+IP2sh4fX5xYKqnp3GNa2uIPJU56MRHWBo9DxNfCE6dnjDzOi vwqMOwQ4lZdHUjQr/6k5P10OOMD4PgGEvsqzka4l8jn+2E9702QuH4IZbwBEure/x7H+ mq3WHW9Kub5uG/5QCqlohGg/V7tWbfdj7nGnzGcVaXn01ZMBZnJt2UrLhCujMXPXgLLX hvu6z5qYlN6VlnfU+9Qk1Nd7EDvaOWp/h9ZOYtGT25EmhSsQJegPtRIX7flyOl75xwp9 Yv4hJDO00Nl21YPYMjWZeDKtbalqI8nBDFfORFqFc42sL/+xyRpDhmIAE34wq6NMSlup w9tA== MIME-Version: 1.0 X-Received: by 10.194.103.38 with SMTP id ft6mr2446525wjb.18.1406696466340; Tue, 29 Jul 2014 22:01:06 -0700 (PDT) Received: by 10.180.77.68 with HTTP; Tue, 29 Jul 2014 22:01:06 -0700 (PDT) In-Reply-To: References: Date: Wed, 30 Jul 2014 13:01:06 +0800 Message-ID: To: Yasuo Ohgaki Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=089e0103eeba2ee03f04ff620b53 Subject: Re: [PHP-DEV] signed long hash index for PHP7? From: tjerk.meesters@gmail.com (Tjerk Meesters) --089e0103eeba2ee03f04ff620b53 Content-Type: text/plain; charset=UTF-8 Hi, On Wed, Jul 30, 2014 at 10:37 AM, Yasuo Ohgaki wrote: > Hi all, > > Current Zend hash uses ulong for numeric array indexes. > This causes bug #67693 > > https://bugs.php.net/bug.php?id=67693 > > Signed/unsigned mismatch is the root cause of this bug. > Since PHP's int is signed by default, it might be better > to change Zend hash index to signed long. > 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? > > I would like to hear comments who understand Zend internals. If there > aren't > issues, we may have signed long index for PHP7. > > I also would like to hear comments for possible fix in released versions. > > Regards, > > -- > Yasuo Ohgaki > yohgaki@ohgaki.net > -- -- Tjerk --089e0103eeba2ee03f04ff620b53--