Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:45145 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 79886 invoked from network); 30 Jul 2009 14:52:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Jul 2009 14:52:15 -0000 Authentication-Results: pb1.pair.com header.from=nlgordon@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=nlgordon@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.224 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: nlgordon@gmail.com X-Host-Fingerprint: 209.85.219.224 mail-ew0-f224.google.com Received: from [209.85.219.224] ([209.85.219.224:35453] helo=mail-ew0-f224.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8D/20-03589-E93B17A4 for ; Thu, 30 Jul 2009 10:52:15 -0400 Received: by ewy24 with SMTP id 24so490974ewy.23 for ; Thu, 30 Jul 2009 07:52:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=yV7JPPAaZuPX1enGE/BfgyyT3FCWzrLlGDK6z1iKhXc=; b=QhKTgdqV+9DzW0YbKx7QrKSpZbfyRxP6JeHDTJcNSvQZcxSixzNiwUE2DiLL0mjGZn WiQPorPQol7XjgOKi1F75fPaAoH7VLiU/SHvuMdGjq9qoguvZZsJsPs2JpuVjwsD4AkS Hr3G1pRWWY3wQYssy8tnsiiyMRvZIJD8A46x4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=VSAfShDAU6hhSur4ZdNcmDGBwi4+B3euF3vwUrs1F9V72jXm1G4axyzpz+OkwNVOl9 voRp3z6YbbRz3GIer/FMfk/kK5QZnqHFlORhq1zYFkaiYk9//WMtctmI3Zq8aN+jHR4t JDA3k8+F2nHoCuUl97JW8ynwKfug3y7NfNAEo= MIME-Version: 1.0 Received: by 10.216.18.195 with SMTP id l45mr265025wel.59.1248965531687; Thu, 30 Jul 2009 07:52:11 -0700 (PDT) In-Reply-To: References: <1248962475.4159.14.camel@goldfinger.johannes.nop> Date: Thu, 30 Jul 2009 09:52:11 -0500 Message-ID: To: Alexey Zakhlestin Cc: =?UTF-8?Q?Johannes_Schl=C3=BCter?= , Guilherme Blanco , PHP internals Content-Type: multipart/alternative; boundary=0016e64c1be2da5f67046fed72ae Subject: Re: [PHP-DEV] Supporting ArrayObject in array_* functions From: nlgordon@gmail.com (Nate Gordon) --0016e64c1be2da5f67046fed72ae Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 2009/7/30 Alexey Zakhlestin > 2009/7/30 Johannes Schl=C3=BCter : > > On Thu, 2009-07-30 at 00:08 -0300, Guilherme Blanco wrote: > >> What do you think about the possibility to support ArrayObject > >> instances in array_* functions? > >> If you all agreed on this, I can definately help to complete the > >> patch, but I need some initial guidance to finish at least the first > >> function. > > > > In general I'm for bringing Iterators/ArrayObject/.. on a line with > > arrays but please don't simply patch some functions but let's try to > > find a as consistent as possible global solution. > > > > Questions included there are of these kinds (just examples) > > - is that specific to ArrayObject or do we "need" interfaces like > > "Sortable" or "Shuffable" > > - What should stuff like aray_merge(ArrayObject, array) do > > - Should we do this globally? (should ldap_set_option() > > allow an ArrayObject as 3rd param?) > > > > Especially the latter shows that a proper solution might be not to patc= h > > individual functions but to introduce some form of abstraction from > > HashTables for "array operations" and then use that interface. > > > > Simply extending a few functions will end in a mess but looking around > > people seem to love these structures so improving them is good. > > agreed. > the proper solution would be to define several interfaces, make > functions accept objects of these interfaces and then add some > "hacks", which would pretend, that array() implements these. > I would vote to extend this concept to user-land functions as well if at al= l possible. It would make my life easier to not care about the implementatio= n of a set of data so long as it conformed to an interface. --=20 -Nathan Gordon If the database server goes down and there is no code to hear it, does it really go down? :wq --0016e64c1be2da5f67046fed72ae--