Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:32309 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 9086 invoked by uid 1010); 13 Sep 2007 12:54:56 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 9071 invoked from network); 13 Sep 2007 12:54:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Sep 2007 12:54:56 -0000 Authentication-Results: pb1.pair.com smtp.mail=andrew@ashearer.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=andrew@ashearer.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain ashearer.com from 68.230.240.8 cause and error) X-PHP-List-Original-Sender: andrew@ashearer.com X-Host-Fingerprint: 68.230.240.8 eastrmmtao102.cox.net Solaris 10 (beta) Received: from [68.230.240.8] ([68.230.240.8:39146] helo=eastrmmtao102.cox.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8B/34-18959-E1339E64 for ; Thu, 13 Sep 2007 08:54:56 -0400 Received: from eastrmimpo02.cox.net ([68.1.16.120]) by eastrmmtao102.cox.net (InterMail vM.7.08.02.01 201-2186-121-102-20070209) with ESMTP id <20070913125452.JMQD24118.eastrmmtao102.cox.net@eastrmimpo02.cox.net>; Thu, 13 Sep 2007 08:54:52 -0400 Received: from [192.168.0.2] ([72.195.132.65]) by eastrmimpo02.cox.net with bizsmtp id nour1X00a1Qoypk0000000; Thu, 13 Sep 2007 08:54:52 -0400 In-Reply-To: <46E82F23.2000506@pooteeweet.org> References: <27DA5A7A-276C-480F-A75C-7F64BB38316B@ashearer.com> <142319111.20070911112759@marcus-boerger.de> <1262949578.20070911172112@marcus-boerger.de> <17c19be0709110933m537df263pfae99322b8ae0b32@mail.gmail.com> <702402878.20070911185402@marcus-boerger.de> <1189531022.30041.88.camel@blobule> <421016323.20070912101332@marcus-boerger.de> <17c19be0709121053u617071beq8d420926f60db46f@mail.gmail.com> <46E82F23.2000506@pooteeweet.org> Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-ID: Cc: Marcus Boerger , Robert Cummings , internals@lists.php.net Content-Transfer-Encoding: 7bit Date: Thu, 13 Sep 2007 08:54:51 -0400 To: Lukas Kahwe Smith X-Mailer: Apple Mail (2.752.3) Subject: Re: [PHP-DEV] [PATCH] array_get() From: andrew@ashearer.com (Andrew Shearer) On Sep 12, 2007, at 2:25 PM, Lukas Kahwe Smith wrote: > Andrew Shearer wrote: > >> Meanwhile, array_get() provides the most-needed functionality >> while avoiding >> the issues that prevented ifsetor's acceptance. > > Aside from lack of BC hacks what is the issue? I remember some > fussing about the name, but I find this a joke of an argument. You > cant get much clearer a name than ifsetor(). > >> There's a backward compatibility problem with ifsetor: its special >> syntax >> means that there's no way to write a pure-PHP userland version of >> it. The >> effect is that there's no upgrade path for applications that have to >> straddle both old and new versions of PHP, and practical >> usefulness of >> ifsetor would be delayed for years after release. > > > I use ifsetor() type functionality on a daily basis. As such I > would appreciate it if it would be an operator and would make its > way not only into php 6, but also php 5.3. > > Marcus's half solution is not a solution to what I need. Andrew's > solution gets close enough to solve my real world needs. Now if I > could just see the slightest bit if a real argument against ifsetor > (), I might even vote for array_get() (not sure if I appreciate the > name though). > > regards, > Lukas I think we want the same thing. We both want the essential functionality in PHP one way or another. If ifsetor was in the running now, I'd support it. But after seeing the discussion and lack of consensus on it since 2004, I'm sure that the best way to reach the goal is to champion array_get(). Other suggestions for the name are welcome, but the choice of it was careful. array_get() has at least one precendent, the Python dict.get () method, which works basically the same way. The fact that the same name and function signature (give or take a reference) was also suggested completely independently in a PHP wishlist item means it's probably on the right track. -- Andrew Shearer http://ashearer.com/