Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62377 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 73133 invoked from network); 21 Aug 2012 22:54:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Aug 2012 22:54:00 -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.176 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.212.176 mail-wi0-f176.google.com Received: from [209.85.212.176] ([209.85.212.176:42272] helo=mail-wi0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E6/CD-10139-68114305 for ; Tue, 21 Aug 2012 18:53:59 -0400 Received: by wibhn17 with SMTP id hn17so4288151wib.11 for ; Tue, 21 Aug 2012 15:53:56 -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=3UTmiq3kYS+XClwbcjNm3Y1LR0wv7l7agL9wNn2q7uA=; b=fSw7M/XGQai8TAOrO5AnkXaKGy+C/DyEhO++BL2xKgG5IKPle3wc3FnZ9WuijSFDhP EzF7Zi8mOrH28BoL9QTV9Qfwdxh3ej5YlNtzHXLelC39rlUh2Hn/IMjvUQzPLEnjj3pJ +xdH5cnDod4faYgKK72RsCXVNGnDSSQjkOH6B9vLB/M7kxQSm0aowV2fk6x4mX1vYkOP 4dIAW4XF+BZt87GCD7qNe0jlSBhO8pglbfLOi7m52W8SNT+3RS+9ARwbg2N+kloQZVxs sDahtKUfLp/7z5jAFU0BE0mIvKebUR62ZmSRWf9DunfvN/fDmQ6Cpim2jdz6Qn/mSOUT 7vFA== Received: by 10.180.83.66 with SMTP id o2mr523295wiy.14.1345589636349; Tue, 21 Aug 2012 15:53:56 -0700 (PDT) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.223.86.201 with HTTP; Tue, 21 Aug 2012 15:53:13 -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 07:53:13 +0900 X-Google-Sender-Auth: e9qGrAo-teiM3jeEDLQIHBhQ9Ro Message-ID: To: Peter Cowburn Cc: Levi Morrison , 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) Hi, 2012/8/22 Peter Cowburn : > On 21 August 2012 23:26, Yasuo Ohgaki wrote: >> array_walk is the best(fast and memory efficient) way >> to delete elements. > > If array_walk() is the best (fast and memory efficient) way to delete > elements, why have we had the following line in the manual, for the > array_walk() callback, for over a decade [1]? (The exact phrasing has > changed slightly one time, but the message has remained the same) > "Only the values of the array may potentially be changed; its > structure cannot be altered, i.e., the programmer cannot add, unset or > reorder elements." > > [1] http://svn.php.net/viewvc/?view=revision&revision=75124 10 years ago log :) I'm not sure, but it had some problems with reference back then. There were many array functions that behaved wrong with reference used to be. I was annoyed by that, probably. That's why I wrote it, I suppose. Good catch. It should be removed now. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net