Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:89979 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30304 invoked from network); 3 Jan 2016 18:35:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Jan 2016 18:35:31 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.46 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.46 mail-wm0-f46.google.com Received: from [74.125.82.46] ([74.125.82.46:38889] helo=mail-wm0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FE/82-28689-2F969865 for ; Sun, 03 Jan 2016 13:35:31 -0500 Received: by mail-wm0-f46.google.com with SMTP id b14so157228496wmb.1 for ; Sun, 03 Jan 2016 10:35:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=Nvu7engR+3bpkcUhikSZqFizgqkXuDpVm0CY3T2rqDY=; b=vCEMVFi3jwqtOSkzxl4+JsWT9JOJmgdrT7eIFb3VZY3ax5d1si6O9H/AfDPiZzR1vE CtaraaKhAWyB486nYt9NJx41orRg17QPnOxkxAmEAeP+fhm3epAL1ZNK6K0Qy4wfuYMS jUbdeEJnoUW8URZdkLE3zbSIJRPV70HtlV8yu+kLdSrKkdhZpnTxUBaSxlG1KsWHRn+x 5F0qVqDW003TX5QCeYxr1/SFAfV9S5mRV5InMMeYlBclLZSx8kqaW6lg8ytAgWLaNTvn Qn9+0qlI6EADroSbM9BFCErjS78M7UnoSeXLdxd97do5hXcE+RCmIIfkDQGYg/CVsEqp zA+Q== X-Received: by 10.194.112.130 with SMTP id iq2mr79226692wjb.102.1451846128268; Sun, 03 Jan 2016 10:35:28 -0800 (PST) Received: from [192.168.1.189] ([2.31.24.87]) by smtp.googlemail.com with ESMTPSA id s8sm30949075wje.35.2016.01.03.10.35.26 for (version=TLSv1/SSLv3 cipher=OTHER); Sun, 03 Jan 2016 10:35:27 -0800 (PST) To: internals@lists.php.net References: <070A1824-9ED7-4863-92AB-A4366AB92C98@zort.net> <86A2B77B-3DCA-420A-A044-C68158E6C4C4@zort.net> Message-ID: <568969E8.2060204@gmail.com> Date: Sun, 3 Jan 2016 18:35:20 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] array_key_(first|last|index) functions proposal From: rowan.collins@gmail.com (Rowan Collins) On 01/01/2016 21:55, Paul Dragoonis wrote: > Thus it would look like this: > $val = $array[array_key_last($array)]; Or how about a matching set of array_value_* functions? Granted, we can currently use reset() and last() for array_value_first() and array_value_last(), but that always feels a bit ugly to me. The name "reset" is hardly obvious, and the side-effects of "resetting the internal array pointer" even less so (e.g. how does it affect copy-on-write?). Regards, -- Rowan Collins [IMSoP]