Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95094 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50105 invoked from network); 12 Aug 2016 11:16:35 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Aug 2016 11:16:35 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@ohgaki.net; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@ohgaki.net; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ohgaki.net designates 180.42.98.130 as permitted sender) X-PHP-List-Original-Sender: yohgaki@ohgaki.net X-Host-Fingerprint: 180.42.98.130 ns1.es-i.jp Received: from [180.42.98.130] ([180.42.98.130:54410] helo=es-i.jp) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 40/01-56950-210BDA75 for ; Fri, 12 Aug 2016 07:16:35 -0400 Received: (qmail 99156 invoked by uid 89); 12 Aug 2016 11:16:31 -0000 Received: from unknown (HELO mail-qk0-f182.google.com) (yohgaki@ohgaki.net@209.85.220.182) by 0 with ESMTPA; 12 Aug 2016 11:16:31 -0000 Received: by mail-qk0-f182.google.com with SMTP id t7so21875268qkh.0 for ; Fri, 12 Aug 2016 04:16:31 -0700 (PDT) X-Gm-Message-State: AEkooutg1O2GZgBg8+FSMHHBrvk86191PxoYGONaIPkNKECMspUziDxGOG5fMQDUtxKz4YHSoVFYC8nn0oC0fw== X-Received: by 10.55.190.199 with SMTP id o190mr16960855qkf.51.1471000585521; Fri, 12 Aug 2016 04:16:25 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.85.242 with HTTP; Fri, 12 Aug 2016 04:15:44 -0700 (PDT) In-Reply-To: References: <10fbcb03-5de8-4d9a-da1c-7e2bf77937cb@lsces.co.uk> <5657afc7-7569-5fc4-4a5a-27ed786c4fa5@gmail.com> <0825c173-5cb4-7f65-cf34-b45ca30919a3@lsces.co.uk> <8646c3ad-b929-cb0b-bad4-52a0a7160d16@gmail.com> <11ce571b-964b-5a3e-9f2f-3f69a8bc20b4@lsces.co.uk> <7d9db8d5-ae7a-4123-14f4-f76fb6d764c5@gmail.com> <1e14c4b9-65ce-4742-589f-19fe9290be0f@lsces.co.uk> <9e2c68fc-4408-a59d-9131-d869a4b88eb2@lsces.co.uk> Date: Fri, 12 Aug 2016 20:15:44 +0900 X-Gmail-Original-Message-ID: Message-ID: To: Lester Caine Cc: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Simple variable handling. From: yohgaki@ohgaki.net (Yasuo Ohgaki) Hi Lester, On Fri, Aug 12, 2016 at 8:13 PM, Yasuo Ohgaki wrote: > On Fri, Aug 12, 2016 at 8:06 PM, Lester Caine wrote: >> On 12/08/16 11:51, Yasuo Ohgaki wrote: >>> What makes you feel missing some or designed badly? >> >> I may be missing something, but I thought the original code had rules >> for each element of the array? I would certainly expect to see the >> capability of setting different validating rules for each element, and >> the rules you are defining are the same rules that would be needed on a >> variable by variable basis? > > You can do > > $get_def_for_an_api = array( > 'date' => $my_date_spec, > 'bookname' => $my_bookname_spec, > 'isbn' => $my_isbn_spec, > ); > > filter_require_var_array($_GET, $get_def_for_an_api); > > One missing validation filter is "optional" filter. I may add this > later or now before starting vote. "optional" filter can be defined by "callback" filter without dedicated filter for optional inputs, BTW. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net