Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94853 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 96890 invoked from network); 5 Aug 2016 11:29:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Aug 2016 11:29:00 -0000 Authentication-Results: pb1.pair.com smtp.mail=php-php-dev@m.gmane.org; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=stadli@gmx.de; sender-id=fail Received-SPF: error (pb1.pair.com: domain m.gmane.org from 195.159.176.226 cause and error) X-PHP-List-Original-Sender: php-php-dev@m.gmane.org X-Host-Fingerprint: 195.159.176.226 unknown Received: from [195.159.176.226] ([195.159.176.226:34790] helo=blaine.gmane.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5F/89-33134-B7874A75 for ; Fri, 05 Aug 2016 07:28:59 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1bVdJ2-0005Qw-L0 for internals@lists.php.net; Fri, 05 Aug 2016 13:28:48 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: internals@lists.php.net Date: Fri, 5 Aug 2016 13:28:47 +0200 Lines: 34 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 In-Reply-To: Subject: Re: [PHP-DEV] Adding validate_var_array()/validate_input_array() to which version? From: stadli@gmx.de (Christian Stadler) Am 04.08.2016 um 21:29 schrieb Yasuo Ohgaki: > On Thu, Aug 4, 2016 at 8:27 PM, Christian Stadler wrote: >> Am 04.08.2016 um 12:10 schrieb Yasuo Ohgaki: >>> On Thu, Aug 4, 2016 at 10:07 AM, Christian Stadler wrote: >>>> Am 01.08.2016 um 10:23 schrieb Yasuo Ohgaki: >>> I don't mind adding this feature. It requires an API like >>> validate_get_offending_value(). (The name should be nicer) >>> How many of us are interested in this feature? >> Then this new function should have an offset param. With this I could >> check, if the array has any offending values and then continue with the >> rest ... mmh, now that I think of it, this isn't really necessary. >> >> Uhm, well anyway: I'd suggest, that the ind(ex/ices) should be returned >> rather, than the actual value names. > OK. Thank you. > I'll add this. The reason why I said store "value" is the code. > To get index, it has to store index somewhere or change many lines of code. Actually I've suggested returning indices, because of the resulting userland-code. Actually I could work with both. So you should choose, whatever is better optimized for the codebase and/or userland-code. On the other hand (@Yasuo and all others): What's your opinion about adding options, rather than more and more new params? e. g.: - FILTER_VALIDATE_EXCEPTION_ON_FIRST_INVALID --> $options & 1 == 1 (default, should be a better/shorter name) - FILTER_VALIDATE_RETURN_VALUES --> $options & 2 == 0 (default) - FILTER_VALIDATE_RETURN_INDICES --> $options & 2 == 1 Just a quick&dirty example, so don't nail me on that ^^ Regards, Christian Stadler