Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62378 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74824 invoked from network); 21 Aug 2012 23:00:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Aug 2012 23:00:52 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.182 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.212.182 mail-wi0-f182.google.com Received: from [209.85.212.182] ([209.85.212.182:37085] helo=mail-wi0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EC/1E-10139-32314305 for ; Tue, 21 Aug 2012 19:00:52 -0400 Received: by wibhq12 with SMTP id hq12so250068wib.11 for ; Tue, 21 Aug 2012 16:00:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=9AqoZz53+rzVpibwBwYjBJVdT3PWukGnMkCXlrWWhTA=; b=PziEnznJagmqmrj35B/6XiwUDu/fgp3F8ES+h++LRWyF6CdNS9SQu7xFfLJejpsLTW yaT+xXKIx2F2ZCj+jS4yhvoOl5pls4doZmAmTsjvcMnrTCKHfAnSGXSwgGjZFGRCqVLc OQfQz6IOqy8BWwqlal+02qQzMEBXdB8g/A5tbJ8cofsK+rc2fZQYdyiYf3GgTXrDLqje tUbhlSJRGrwrZ7IK/HveSe2CfkGdrdojdVlocSiR+1EzvLNvHJL04GOqc+7CAWfuJ4Zt kHusPyuREx1okl1BZNWB0u0GBRlBqCIVYREsnasiXAsPgMQ1+/KMsqwLP2kzP5TBpJI1 i8oA== Received: by 10.180.105.6 with SMTP id gi6mr620475wib.4.1345590048934; Tue, 21 Aug 2012 16:00:48 -0700 (PDT) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.223.86.201 with HTTP; Tue, 21 Aug 2012 16:00:08 -0700 (PDT) In-Reply-To: References: <5033E0BC.8040507@ajf.me> <5033EAAB.6090502@ajf.me> <5033F1EA.4070701@ajf.me> <5033FD9C.6080106@ajf.me> <5033FF96.5030105@ajf.me> <5034017E.1020002@ajf.me> Date: Wed, 22 Aug 2012 08:00:08 +0900 X-Google-Sender-Auth: DsZ1OCkeUeO8N-kk95_AwvEstuw Message-ID: To: Levi Morrison Cc: Andrew Faulds , Tjerk Anne Meesters , Rasmus Schultz , internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] re: removing an item from an array From: yohgaki@ohgaki.net (Yasuo Ohgaki) 2012/8/22 Levi Morrison : >> Why did you change the equivalent code? >> array_walk is the best(fast and memory efficient) way >> to delete elements. >> >> This code may be refereed from old PHP users, therefore >> we should write better code. >> >> If you don' t have good reason to do so, please revert >> the change. > > The implementation you had may be faster, but that is certainly NOT > what matters as long as both are correct. What matters in the RFC is > clarity. You have already said that too many people don't know about > array_walk, so why would they understand array_delete in terms of > array_walk? Please do not revert the change as what I have written is > more clear. I don't say array_walk() is difficult, but people out there just don't know it. Why we should use inefficient example for internals? Besides, if array_walk() is used, people who would like to write patch for it will knew that most of code can be borrowed from array_walk(). Thus, it may prevent reinventing wheel. > The reason speed doesn't matter in behavior example is that once it is > implemented in C it will be just as fast as array_walk, perhaps it > will even be faster. I cannot agree to this opinion. I still think the example should be reverted. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net