Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94821 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 70027 invoked from network); 4 Aug 2016 04:23:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Aug 2016 04:23:22 -0000 Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.53 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.218.53 mail-oi0-f53.google.com Received: from [209.85.218.53] ([209.85.218.53:35987] helo=mail-oi0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0E/B1-53111-633C2A75 for ; Thu, 04 Aug 2016 00:23:19 -0400 Received: by mail-oi0-f53.google.com with SMTP id f189so33719495oig.3 for ; Wed, 03 Aug 2016 21:23:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=yKB04OhXWOGDR3TPpyJe3oWSMqB9UOtYVsAmRwZrimQ=; b=lKY5ttXr4pQAlBhNTYggyQRVee2YiDKvkVIUyUbH7TnVC6TyHGyhPuJwk/ELDII5V/ AEts9Jcvcugp6k5awXBoUPLwBqQYQVq33CvTtVN21Of3A8TV1MvHswpdtnghyCVhmb9j 6J06JXEzgGNR8VrvslXVOXHFf/KQMi8b/ef4LcSnPDj4vGfoTsYMQ70+/Vd1grof7ZRI zinM40Bo0GiSBJI1+iJvdaum2bFacxGNRz/FYDItqfGB7ab8E7+EkP6VCXtfG6cVtjEH SsSkq4UMtId1cEJ9drWi1ZhKBXvVnxbQnHDpJqYO2UMNDEVPIRqC7kG3TQRHWKXhA1Ld lCWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=yKB04OhXWOGDR3TPpyJe3oWSMqB9UOtYVsAmRwZrimQ=; b=KGit03jHun2r7m/x/ikkEzRej3HlfjHM9XGW4MgOOF2gCEUa8WvfwTDH08BqgpGVx6 2vA3MCx4Cy+Uh9EV9y4iOMMHO2kEpxlaiN33TgkEMMAS26zXYYD8jOli4AE2KW1fZh77 GV+FL5LvZRlOIVHpQnf96fG7io/mdm1Gw01T2BBY8KHi5I03R3W90KBcCFl+yS6jH0vc JKYNXVVBaA6JyoCbnpcknxjWjP9SONYiZ7MyPQNbTlqkzT/3CvQ1MIQwjbATwij3EAiK bRSj90QOkqGOztOpgmwOz9rQitrKdWh7nhN7P5PKLe9bDb3jQx5uoMbvVWRO3okKtHtV BVZQ== X-Gm-Message-State: AEkoouupL/s1J+meEUMb/GCqjlx9PjpU++mtl5RJEqOpkE0vx4DemUiTrrcWUfRQA6KwH/nj2y7nx+rmOBFIQQ== X-Received: by 10.202.60.65 with SMTP id j62mr38755308oia.3.1470284596097; Wed, 03 Aug 2016 21:23:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.202.53.135 with HTTP; Wed, 3 Aug 2016 21:23:15 -0700 (PDT) In-Reply-To: References: Date: Thu, 4 Aug 2016 11:23:15 +0700 Message-ID: To: Yasuo Ohgaki Cc: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC][DISCUSSION] Add validation functions to filter From: pierre.php@gmail.com (Pierre Joye) Hi Yasuo, On Wed, Aug 3, 2016 at 1:43 PM, Yasuo Ohgaki wrote: > Hi all, > > This RFC is to add validation functions and string validation filter. > > https://wiki.php.net/rfc/add_validate_functions_to_filter > > It also allows to define multiple filters for an input. i.e. You can > apply multiple filter rules for an input. > > Comments are appreciated! Thanks for this proposal :) Some comments: Exceptions are not exceptional in this case but if there are invalid options or arguments but everything else is expected to succeed or fail. So I am not in favor to have exception here. Naming must have filter_ prefix We do have array filters, validate or filtering functions already I am not sure why we need another function to do very similar things. Most if not all ext/filter users (libraries, components, frameworks) implements their own userfriendly interfaces (classes) and use the existing filter APIs. The developers I talked to prefer to have simple functions but fast, high quality and safe rather than complex APIs for a specific flow, which is most likely won't match their needs. Most of these higher level APIs are also using different approaches and OO based, which simplifies a lot their usage. Cheers, Pierre