Re: RFC Idea - is_json - looking for feedback
| From: | Juan Basso | Date: | Mon, 01 Aug 2022 02:16:42 +0000 |
| Subject: | Re: RFC Idea - is_json - looking for feedback | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-118334@lists.php.net to get a copy of this message | ||
I think the arguments are good enough for the RFC. However, I would like to
propose using a different API. Instead of creating a new global function
that could conflict with existing applications, use filter_var validations
since it is basically a validation. You can do something like
filter_var($possibleJSON, FILTER_VALIDATE_JSON). Over time, if there is a
need for extra parameters you can still use the filter_var flags or options
(3rd parameter) to indicate if you want just JSON Object, JSON Array, JSON
scalar, etc.
Juan Basso
On Sun, Jul 31, 2022 at 3:46 PM juan carlos morales <
dev.juan.morales@gmail.com> wrote:
> Hi Juan,
> >
> > Thanks for your efforts, and examples.
> >
> > You are solving a common use case, in frameworks, libs, and general
> > userland.
> >
> > This much needed function will see good perf/memory improvements once
> > adoption of is_json() hits popular libs and frameworks.
> >
> > I will be voting in favor of this addition, subject to reviewing the
> > implementation and full RFC.
> >
> > Thanks for the effort. Looking forward to seeing it merged :)
> >
> > Many thanks,
> > Paul Dragoonis
> >
> >
> >
> >>
> Hello Paul, and sorry, I totally missed your message, thanks for the kind
> feedback, you made my day.
>
> So, if I get it correctly, I have green light to move on with the RFC
> process right? so ... I will move on. Once everything is done I will ping
> again.
>
> Regards,
>
> Juan
>
> PD: I had to re-send the message as it was too long, ... I am using a
> mailing list for the first time ever :)
>