Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:32553 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 67361 invoked by uid 1010); 2 Oct 2007 15:37:24 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 67346 invoked from network); 2 Oct 2007 15:37:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Oct 2007 15:37:24 -0000 Authentication-Results: pb1.pair.com smtp.mail=malterisio777@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=malterisio777@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 64.233.162.237 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: malterisio777@gmail.com X-Host-Fingerprint: 64.233.162.237 nz-out-0506.google.com Received: from [64.233.162.237] ([64.233.162.237:54087] helo=nz-out-0506.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 12/91-57391-3B562074 for ; Tue, 02 Oct 2007 11:37:24 -0400 Received: by nz-out-0506.google.com with SMTP id x7so2872036nzc for ; Tue, 02 Oct 2007 08:37:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=DFfVlLv9txDEPCuOjTKN5aV5cNC5szJxojxEqaprYMQ=; b=Kkf6pYVyLA5jQ8eWJ0pjEPILebdj8nOpMEmMlDehDvayFOCob3JwxyhHiDigcxbP9+QHvN2Q6haX8eAe3VQ+GU08pvotpWsppDj15HnTukGkfyqIYh/vJJ6uHNW6G85hMcapNh6E2+1j1hbvCMS2YNFA8cCKZ3lceoB5nXdR4lg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=iCTjDQDaQuSTfSoyPyh+FfnWDk8ZQSjrk0+rkeANXwkRbjVcpcmy2QIJ8or7k8Z8SHvwqushI3+ErwUxCRy72UpK2gwPGzVyQdKkh6MRfaIy8NG7BRQO5fdp34kCMszk8KuecEUqmvxyVNJbVh/xZyryrc5MiFZJyjU84Ce+Z8M= Received: by 10.114.81.1 with SMTP id e1mr3095298wab.1191339440249; Tue, 02 Oct 2007 08:37:20 -0700 (PDT) Received: by 10.115.47.6 with HTTP; Tue, 2 Oct 2007 08:37:20 -0700 (PDT) Message-ID: <52dbac0f0710020837m6a687f1y385a278818870223@mail.gmail.com> Date: Tue, 2 Oct 2007 12:37:20 -0300 To: "Alexey Zakhlestin" Cc: "PHP Developers Mailing List" In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_10334_10550620.1191339440247" References: <52dbac0f0710011236u626c9566l6ab474dce0b3132e@mail.gmail.com> Subject: Re: [PHP-DEV] substr/array_slice in [] From: malterisio777@gmail.com ("Martin Alterisio") ------=_Part_10334_10550620.1191339440247 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 2007/10/2, Alexey Zakhlestin : > > On 10/1/07, Martin Alterisio wrote: > > Sorry to bother, I have a few questions on this matter. > > How will this impact on the SPL ArrayAccess and related interfaces and > > objects? > > Will there be an interface to this functionality? > > If so, how will ranges be passed through to this interface? > > Will this be consistent with substr() and array_slice() if used with an > > ArrayAccess implementation? > > I guess it can be made to work with current ArrayAccess, but result > will be quite slow. (it will need to query requested elements > one-by-one and recombine those in array) > > But adding another interface can solve the problem. Ranges can be > passed exactly the way they are passed to [] operator > > public function rangeGet($start, $length); > public function rangeSet($start, $length, array $data); > > > -- > Alexey Zakhlestin > http://blog.milkfarmsoft.com/ > In that case rangeSet shouldn't have the third argument type hinted. The supplied data could be an ArrayAccess implementor. ------=_Part_10334_10550620.1191339440247--