Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:25732 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 73085 invoked by uid 1010); 16 Sep 2006 14:46:32 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 73070 invoked from network); 16 Sep 2006 14:46:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Sep 2006 14:46:32 -0000 Authentication-Results: pb1.pair.com smtp.mail=cschneid@cschneid.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=cschneid@cschneid.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain cschneid.com from 195.226.6.42 cause and error) X-PHP-List-Original-Sender: cschneid@cschneid.com X-Host-Fingerprint: 195.226.6.42 darkcity.gna.ch Linux 2.5 (sometimes 2.4) (4) Received: from [195.226.6.42] ([195.226.6.42:45112] helo=mail.gna.ch) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4C/6B-23155-64E0C054 for ; Sat, 16 Sep 2006 10:46:31 -0400 Received: from localhost (localhost [127.0.0.1]) by darkcity.gna.ch (Postfix) with ESMTP id D7F92C432D; Sat, 16 Sep 2006 16:46:27 +0200 (CEST) Received: from unknown by localhost (amavisd-new, unix socket) id client-XXyeQjaw; Sat, 16 Sep 2006 16:46:24 +0200 (CEST) Received: from [192.168.1.42] (217-162-171-242.dclient.hispeed.ch [217.162.171.242]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by darkcity.gna.ch (Postfix) with ESMTP id 92815C4314; Sat, 16 Sep 2006 16:46:23 +0200 (CEST) Message-ID: <450C0E3F.8070005@cschneid.com> Date: Sat, 16 Sep 2006 16:46:23 +0200 User-Agent: Thunderbird 1.5.0.7 (Macintosh/20060909) MIME-Version: 1.0 To: Pierre CC: internals@lists.php.net, derick@php.net, rasmus@php.net, ilia@prohost.org References: <20060916125431.42e9a5dd@pierre-u64> <450C02B3.10103@cschneid.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at gna.ch Subject: Re: ext/filter, Final API proposal From: cschneid@cschneid.com (Christian Schneider) Pierre wrote: > 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. Makes sense but the example shows: $args = array( ... 'versions' => FILTER_SANITIZE_ENCODED, resulting in array(6) { ... ["versions"]=> array(1) { [0]=> string(6) "2.0.33" } instead of the (by me) expected array(6) { ... ["versions"]=> string(6) "2.0.33" even though FILTER_FLAG_ARRAY is not given for versions. I see three possibilities and wonder which one is true: a) This is a documentation bug b) FILTER_FLAG_ARRAY is 'inherited' from the previous arg ('component') c) The values are always returned as array My favourite one being a) :-) > It uses INPUT_REQUEST (which is not yet implemented, and will not be > for 5.2.0). One should rely only on the constants not their values :) I agree wholeheartedly but I think it would be nice to have INPUT_REQUEST for 5.2.0 already. Or are you advising people to use $myinputs = input_get_args(INPUT_GET, $args, $data) + input_get_args(INPUT_POST, $args, $data) [ + ... ]; as work-around for now? Just wondering... > However, the point was about the API changes (signature, way to call > them, etc...). I suppose you like it? Yes, the API looks great as far as I can tell. - Chris