Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:25769 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 47217 invoked by uid 1010); 19 Sep 2006 21:45:05 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 47202 invoked from network); 19 Sep 2006 21:45:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Sep 2006 21:45:05 -0000 Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass; domainkeys=good Received-SPF: pass (pb1.pair.com: domain gmail.com designates 64.233.182.184 as permitted sender) DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 64.233.182.184 nf-out-0910.google.com Linux 2.4/2.6 Received: from [64.233.182.184] ([64.233.182.184:25150] helo=nf-out-0910.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 87/9D-54096-FD460154 for ; Tue, 19 Sep 2006 17:45:05 -0400 Received: by nf-out-0910.google.com with SMTP id y25so322543nfb for ; Tue, 19 Sep 2006 14:45:01 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=eIUcH1M3vGSoVthDd7snddChkxD/124CCBOi/bqDpD0XX9SjnNss9Yt9dJyfekmZQKJYuZeRRaCU8G9Li9d1HFYq/wLLUetTSM+3t0IIJwSNfPGS5DiZL45hCizFNMjoang14sJ0eVN5XDrj/nDxM+qjqPio8hsyLhpzmLKeaVs= Received: by 10.78.157.8 with SMTP id f8mr4060929hue; Tue, 19 Sep 2006 14:45:01 -0700 (PDT) Received: by 10.78.137.6 with HTTP; Tue, 19 Sep 2006 14:45:01 -0700 (PDT) Message-ID: Date: Tue, 19 Sep 2006 23:45:01 +0200 To: "Derick Rethans" Cc: "Christian Schneider" , internals@lists.php.net, rasmus@php.net, ilia@prohost.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20060916125431.42e9a5dd@pierre-u64> <450C02B3.10103@cschneid.com> Subject: Re: [PHP-DEV] Re: ext/filter, Final API proposal From: pierre.php@gmail.com (Pierre) Hello, On 9/19/06, Derick Rethans wrote: > > > unless FILTER_FLAG_ARRAY is given in which case it should behave like > > > before. This would make it easier to use the filtered values IMHO. > > > > It always returns an array when FILTER_FLAG_ARRAY is given. Even when > > the input value was a scalar. It spares yet another is_array/isset > > test. And it accepts only scalar by default or when FILTER_FLAG_SCALAR > > is given. > > I would not expect that... I thought the FLAG would just mean that it > would iterate over a whole array and allow it. I think that we should > add a second flag called "FORCE_ARRAY" or something instead. The flag allows arrays and always returns an array. It is obvious as if you allow array or scalar, you have to use is_array, that's a step we easily drop internally by always returning an array. I do not see the point to have ALLOW_ARRAY and FORCE_ARRAY. It is confusing. --Pierre