Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100372 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48248 invoked from network); 4 Sep 2017 18:56:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Sep 2017 18:56:47 -0000 Authentication-Results: pb1.pair.com smtp.mail=crocodile2u@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=crocodile2u@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.175 as permitted sender) X-PHP-List-Original-Sender: crocodile2u@gmail.com X-Host-Fingerprint: 209.85.217.175 mail-ua0-f175.google.com Received: from [209.85.217.175] ([209.85.217.175:33770] helo=mail-ua0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F9/1F-04538-DE1ADA95 for ; Mon, 04 Sep 2017 14:56:46 -0400 Received: by mail-ua0-f175.google.com with SMTP id g47so3398504uad.0 for ; Mon, 04 Sep 2017 11:56:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=tB1IcMOgoGSspfkRQ4wceDo9LY65ry4f7LKHrQcE0Ok=; b=Idgeygva3xL1yUeErqfprS7CNFoh5ETxmCyI7ZJRgFkiKdpgOH8VQRxAJbmXwnCMU+ NWyhSA0ySzRZ1aRPO7FX5ywnA950JyB5NOayMmfw1TEC0j+hZ+TeaJKA1RunLu9D9Kjq WHSwOyUhBI+s5SMv0bLjaRmT3tFkuKGKoc7kSMIYnNFnifRnVKqbwbZSzZMn3VW1UZMR T/eP9fO+VgDnnp8uOZJ6HHt2Nu86xDwnaV2lDn71entAYCkn5TPiuf7iFo+U4fXb1mcq ZJB0ogGej1zqOJKTF+Mb4nZB4ug4JifHNlGtEyOiOcb8wuwR28oNGqbgHHBkb2kryD9E EtuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=tB1IcMOgoGSspfkRQ4wceDo9LY65ry4f7LKHrQcE0Ok=; b=WTmpkv0eNLwYY5inOf0le+nRd/CeGRoo8iML47uQa01OGIL6s9j2cwl+fHjY7+Y9Sj NvHr2SjmiJl7PiDiOQecbX1/d2tZ9DoaIjH2/zpi3C7kAFVvGUdCiqSiNw7kLA7wRUA7 SYgiq8T3Q8IddKYbrjJN72QR0snqsOvTp/AtIEZvmo0GNLWp7QKBG21R8rJa6ze7+GTX 5Wfpnx2oeLZp4OZ/ipTQpMFCiK0kH8tGxtUBaUcEcW5T9fuX7CGOMFXfHYBrTc8yaj8Y NINU/QpGAPYEKmeOz9iX5X6p7SF7A+BY4ulnZRbIb6yFbYefajyjMPYO+MkgsBca8XIY Ledw== X-Gm-Message-State: AHPjjUjXgfdEMXZfkuH7GEzG1Wwwv72IRQVnUK2W6U2zJ5HEnfccVMWU d/D14j9M3ZXxLQ6BdJ21BKJYl1ugkg== X-Google-Smtp-Source: ADKCNb5BBEVPnI+Y/SjwTYXVx2lGo2hJG1Fsx9KwbALsaDpRHEDBYqRpuKQgGf+0kCgFaih73IcoNraJGxhskKmNr2U= X-Received: by 10.159.55.145 with SMTP id q17mr986301uaq.88.1504551403255; Mon, 04 Sep 2017 11:56:43 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 04 Sep 2017 18:56:32 +0000 Message-ID: To: Rowan Collins , Yasuo Ohgaki , "internals@lists.php.net" Content-Type: multipart/alternative; boundary="94eb2c0401f8effcc3055861abd3" Subject: Re: [PHP-DEV] A validator module for PHP7 From: crocodile2u@gmail.com (Crocodile) --94eb2c0401f8effcc3055861abd3 Content-Type: text/plain; charset="UTF-8" In most cases users would like more than just valid/invalid, i. e. which particular rule(s) failed and also human-readable error messages. As of simple validation that is almost always at hand, filter_* functions do a good job, although I agree that they could be better. I, for one, would like to see a full-featured validation as part of PHP. However, this RFC only looks like a slightly better version of filter_* functions, that is, the new module will provide almost the same functionality but with a different interface. I would vote against it. On Mon, Sep 4, 2017 at 2:54 PM Rowan Collins wrote: > On 4 September 2017 07:33:41 BST, Yasuo Ohgaki wrote: > >Hi all, > > > >I spent a little time for a new input validation module. It's not > >totally > >new module, but is based on Filter module's validation filter > >improvement > >RFC in many ways. [1] > > Hi Yasuo, > > Thanks for tackling this. I do think the current filter module is user > unfriendly and it would be great to have something better. A couple of > quick thoughts based on your README: > > - The use of nested arrays keeps things simple in one sense, but the deep > nesting can get confusing. I wonder if a ValidationRule class would make > the distinction between parameters and references to existing rules > clearer. This would also give you a natural home for validating the > validation rules themselves (probably by throwing an exception in the > constructor). > > - A minor point, but most style guides would suggest function names should > be verbs, not adjectives, so "validate()" rather than "valid()". > > - Is there a use case for valid_id() or is it a temporary debugging thing > that won't be in the final version? > > In general, I like the idea, but would have to play around a bit to see if > it felt easy to use in real world situations. > > Regards, > > -- > Rowan Collins > [IMSoP] > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Best regards, Victor Bolshov --94eb2c0401f8effcc3055861abd3--