Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:46593 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 79745 invoked from network); 2 Jan 2010 16:47:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Jan 2010 16:47:16 -0000 Authentication-Results: pb1.pair.com header.from=patchnow@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=patchnow@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.78.25 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: patchnow@gmail.com X-Host-Fingerprint: 74.125.78.25 ey-out-2122.google.com Received: from [74.125.78.25] ([74.125.78.25:12698] helo=ey-out-2122.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 97/FF-12956-3987F3B4 for ; Sat, 02 Jan 2010 11:47:16 -0500 Received: by ey-out-2122.google.com with SMTP id 9so2542481eyd.39 for ; Sat, 02 Jan 2010 08:47:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=71zwNcQ0c1pYr7quPuzDkV/cOyVv2OW1WPFsDqfLjIo=; b=eZEOBYDx1djY+HAEP/5u+1SHvoWzCnv46DZ7V/lQfy29TGmsnJEZnkYYW5yptFhUup Ow4Ye3o90QvbM72ZTGjWqtlS1z+MI4KF1HtwsxKxkd/jEjt+4MoQT1JOGlq2hJJTr7U3 Rud+wmlzuXoib/Jiu/wvbW3NXKGdKTbJY/gNs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=Eiu7+IQHBowb/gxcrsV2YHEFwB+/f1nQiT+/mdhC7Qgh/9driMjp0IZE5KtXy2159r q1TYBpNzxN+lzY9g6Igg4T+hiQFu0UJkOVyabRlT7C7TYVo8TbKM1M0IaxpxxnfQUFFZ 9OAFmwT1r/1rNaV1Q1GZX3RI0cn222Qo1D5Uo= Received: by 10.213.43.66 with SMTP id v2mr4851606ebe.19.1262450832697; Sat, 02 Jan 2010 08:47:12 -0800 (PST) Received: from ?192.168.0.80? (xdsl-89-0-181-19.netcologne.de [89.0.181.19]) by mx.google.com with ESMTPS id 14sm11452990ewy.7.2010.01.02.08.47.10 (version=SSLv3 cipher=RC4-MD5); Sat, 02 Jan 2010 08:47:11 -0800 (PST) Message-ID: <4B3F788E.7090200@gmail.com> Date: Sat, 02 Jan 2010 17:47:10 +0100 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0 MIME-Version: 1.0 To: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: array position isfirst / islast / valid ? From: patchnow@gmail.com (Oskar Eisemuth) Hello Would it be possible to add functions to know the relative internal array position? I found "[PHP-DEV] RFC array functions" from 2006, but nothing really changed. The need to use next, prev in combination is ridiculous compared to a clean array_hasmore or array_pos_islast, as the internals already know this. To get an array_valid_position or array_pos_isvalid wouldn't be bad either. So would it possible to introduce: array_pos_isfirst(& $array) array_pos_islast(& $array) array_pos_isvalid(& $array) Best regards Oskar Eisemuth