Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78267 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68580 invoked from network); 23 Oct 2014 10:38:54 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Oct 2014 10:38:54 -0000 Authentication-Results: pb1.pair.com header.from=pthreads@pthreads.org; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=pthreads@pthreads.org; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain pthreads.org from 209.85.212.171 cause and error) X-PHP-List-Original-Sender: pthreads@pthreads.org X-Host-Fingerprint: 209.85.212.171 mail-wi0-f171.google.com Received: from [209.85.212.171] ([209.85.212.171:39443] helo=mail-wi0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 25/64-41150-BBAD8445 for ; Thu, 23 Oct 2014 06:38:52 -0400 Received: by mail-wi0-f171.google.com with SMTP id em10so3719093wid.10 for ; Thu, 23 Oct 2014 03:38:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:content-type:mime-version:content-transfer-encoding; bh=lOAqk6/Fm+fjdC/+qNXaKQOA6MhNv7IEelLbvDgzea4=; b=FOMJWCdQaRvZDXhd3q91c7/rMPcTrQ9p9WKU45k5I71uV/naoQofNaADx8s2cx/Cmf 4PCcZGWHTPCKYra0YH9/P8g6XuRymF7xHdYU/DTIgug7L9FW5V7iu1FO3f7udVbBtgsv vBKPfJwRg7XxQZimM4/bwiyOgJqqyu30hRWpsJoqE2730MtLbqgqlTv8Utw3c7ZIk5rR Ekr5YArLVlP8Fmd2lxnZpKMvyygDjU34AKYY6HpxeV1W3tEfm4DLMea98/6+psuJIOcE fCZ3CNP5LrdoXpI5+ekSqxktS9D1LWHROT23YdHrHgSCMv0+bVa90VkJvDcci7rsbQMr HyUA== X-Gm-Message-State: ALoCoQmwmezRIHBrETPYFLGkMoCsFtyETGflts7q/jd/SBh1NmrpIV+YGxNnv63CRB9uCTIW7G9m X-Received: by 10.194.21.106 with SMTP id u10mr3043750wje.109.1414060728632; Thu, 23 Oct 2014 03:38:48 -0700 (PDT) Received: from [192.168.1.67] (host86-136-245-20.range86-136.btcentralplus.com. [86.136.245.20]) by mx.google.com with ESMTPSA id bc5sm1689252wjb.14.2014.10.23.03.38.47 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 23 Oct 2014 03:38:47 -0700 (PDT) Message-ID: <1414060726.2624.60.camel@localhost.localdomain> To: Dmitry Stogov Cc: Stas Malyshev , Philip Hofstetter , PHP Internals Date: Thu, 23 Oct 2014 11:38:46 +0100 In-Reply-To: References: <1413875212.2624.3.camel@localhost.localdomain> <54469840.3070708@sugarcrm.com> <1414051917.2624.35.camel@localhost.localdomain> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4 (3.10.4-4.fc20) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] UString From: pthreads@pthreads.org (Joe Watkins) On Thu, 2014-10-23 at 12:44 +0400, Dmitry Stogov wrote: > this won't completely solve the problem, because array keys won't be > UString anymore. http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html#hashCode() Others solve this problem in exactly this way, the Java implementation requires that you return an int. The one in that draft will allow you to return any scalar. This is much more suitable for PHP. It doesn't solve the problem directly but allows the programmer to solve it for themselves, just like Object.hashCode in Java. > > Thanks. Dmtiry. > > > On Thu, Oct 23, 2014 at 12:11 PM, Joe Watkins > wrote: > On Tue, 2014-10-21 at 10:30 -0700, Stas Malyshev wrote: > > Hi! > > > > > I wish there was a way for specific objects to opt into > this. > > > > There will be, if __hashKey() or whatever would be the > properly > > bikeshedded name, becomes reality as discussed elsewhere. It > shouldn't > > be hard to do and it's exactly what many other languages do > when trying > > to use objects as keys for maps. > > > > > > Not ready for discussion yet ... > > https://wiki.php.net/rfc/hashkey > > But it exists, I think it solves a problem for ustring in > particular but > it solves the problem in general too. No time to write about > it or > discuss it at this moment, but in pipeline, hopefully ... > > Cheers > Joe > Cheers Joe