Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78497 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 31510 invoked from network); 30 Oct 2014 23:20:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Oct 2014 23:20:57 -0000 Authentication-Results: pb1.pair.com header.from=lester@lsces.co.uk; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=lester@lsces.co.uk; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lsces.co.uk from 217.147.176.214 cause and error) X-PHP-List-Original-Sender: lester@lsces.co.uk X-Host-Fingerprint: 217.147.176.214 mail4-2.serversure.net Linux 2.6 Received: from [217.147.176.214] ([217.147.176.214:55747] helo=mail4.serversure.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E6/72-17925-7D7C2545 for ; Thu, 30 Oct 2014 18:20:56 -0500 Received: (qmail 27024 invoked by uid 89); 30 Oct 2014 23:20:52 -0000 Received: by simscan 1.3.1 ppid: 27017, pid: 27020, t: 0.1876s scanners: attach: 1.3.1 clamav: 0.96/m:52/d:10677 Received: from unknown (HELO ?10.0.0.8?) (lester@rainbowdigitalmedia.org.uk@86.163.79.60) by mail4.serversure.net with ESMTPA; 30 Oct 2014 23:20:52 -0000 Message-ID: <5452C7D3.2060506@lsces.co.uk> Date: Thu, 30 Oct 2014 23:20:51 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 MIME-Version: 1.0 To: internals@lists.php.net References: <544DA1CD.9070109@php.net> <4ED7146272E04A47B986ED49E771E347BD7E35E061@Ikarus.ameusgmbh.intern> <51CF9ADE-2E04-4BC0-9E5C-B93498251F59@php.net> <5452158A.6070003@lsces.co.uk> <2BB0BBCF-87D2-4E13-9B59-B18A17572B37@gmail.com> <54526AE0.7060702@lsces.co.uk> <5452786E.7020503@gmail.com> In-Reply-To: <5452786E.7020503@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Using objects as keys From: lester@lsces.co.uk (Lester Caine) On 30/10/14 17:42, Rowan Collins wrote: > The use case which came up recently was UString objects, which can > easily be converted to and from plain PHP strings, but would be useful > as keys in their own right. With current PHP you could do $foo[ > (string)$u_str ] = $bar; with the proposed RFC, you could do $foo[ > $u_str ] = $bar with the same result; but either way, you would still > need to convert *back* to an object in order to use any of the UString > methods in a foreach(), array_walk(), etc. I would still like to see the debate on proper use of unicode IN PHP strings. Pushing that problem into objects is just as wrong as this debate. If I'm using a unicode colation to sort a set of array keys then the KEY should be unicode, not yet another handle to a secondary object which the needs to be sorted ... but then perhaps we need this fiddle to avoid the complexity that unicode can create? -- Lester Caine - G8HFL ----------------------------- Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk Rainbow Digital Media - http://rainbowdigitalmedia.co.uk