Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:47375 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65302 invoked from network); 17 Mar 2010 17:55:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Mar 2010 17:55:16 -0000 Authentication-Results: pb1.pair.com smtp.mail=felix.devliegher@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=felix.devliegher@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.78.27 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: felix.devliegher@gmail.com X-Host-Fingerprint: 74.125.78.27 ey-out-2122.google.com Received: from [74.125.78.27] ([74.125.78.27:18202] helo=ey-out-2122.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 56/5B-05162-38711AB4 for ; Wed, 17 Mar 2010 12:55:16 -0500 Received: by ey-out-2122.google.com with SMTP id d26so3688eyd.39 for ; Wed, 17 Mar 2010 10:55:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=bdlT68GWwa9Nb+OWQixmrvUwbkPpXaIWySZXWwmqnrk=; b=toIVtC8qzCj2DxNgK958u83L9GqD/7Lgl2d1pLhKgMG709MQ7YJc70cnPUxGGKjP9i KN7BRNy5/kXMi2PtQKb5ERwHd0kBjrcO6+Mi1MzXl3C+0xn59NPYbna1fUIxwxP5CNFo IX58w0/CRBzYk9LAVjoCS6wLyESr0cts8uBYY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=ORJNEgl0LvVCqOiXxvy2lTcfCmytOkRUhQ96TUCDhW3p1up7JNwzQYNFvhlOMXSZPd fNAaXNuYHZ1dthKX9AHg7A8WvLdqXznzinUvyzxRZ+dQRMU8ArRspRR3Z3qNEoSVI62t 1P0CPh/DjgnbtWkgApB+M1/j1JNWOkSo44oFk= Received: by 10.213.23.92 with SMTP id q28mr6988665ebb.33.1268848512622; Wed, 17 Mar 2010 10:55:12 -0700 (PDT) Received: from [192.168.2.10] (94-225-45-193.access.telenet.be [94.225.45.193]) by mx.google.com with ESMTPS id 16sm4273826ewy.3.2010.03.17.10.55.10 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 17 Mar 2010 10:55:11 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset=us-ascii In-Reply-To: Date: Wed, 17 Mar 2010 18:55:09 +0100 Cc: Frederic Hardy , PHP internals Content-Transfer-Encoding: 7bit Message-ID: References: <6E76B52E-7543-4F09-A948-A7910513B548@gmail.com> <4BA102F2.1000405@mageekbox.net> <62279C8B-4E50-47DE-B682-EE8152084433@gmail.com> To: Derick Rethans X-Mailer: Apple Mail (2.1077) Subject: Re: [PHP-DEV] array_seek function From: felix.devliegher@gmail.com (Felix De Vliegher) On 17-mrt-2010, at 17:52, Derick Rethans wrote: > On Wed, 17 Mar 2010, Felix De Vliegher wrote: > >> On 17-mrt-2010, at 17:27, Frederic Hardy wrote: >>> >>> Why not use arrayIterator::seek() ? >> >> Because the functionality isn't exactly the same. >> ArrayIterator::seek() only sets the array pointer, array_seek would >> also return the value + have fseek()-like functionality with the >> SEEK_* consts and optional negative offsets. > > To be honest, I'd rather have the proposed array_seek() return a status > whether the seek worked or not. Notices are uncool and you can already > retrieve data/key with key() and current(). > Update: http://phpbenelux.eu/array_seek-return.patch.txt I've kept the fseek()-style return values (0 when fine, -1 when seek fails) Cheers, Felix