Re: RFC Idea - is_json - looking for feedback

From: Date: Sat, 30 Jul 2022 22:55:54 +0000
Subject: Re: RFC Idea - is_json - looking for feedback
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-118325@lists.php.net to get a copy of this message
On Sat, Jul 30, 2022, 4:48 PM David Gebler <davidgebler@gmail.com> wrote: > > > What I'm asking is what's the practical use for this proposed function? > Where are you likely to need to know if a string is valid JSON but not have > to (try to, with error handling) parse it almost immediately afterwards > anyway? > I'm still on the fence over the general idea, but I thought I could at least address this question in particular. I can definitely see it's usefulness on public HTTP API ingesting data (specially large data) where if the payload is a valid JSON, it gets stored and processed by a background queue, making it so that the HTTP layer can either reject the request with a 4xx status or accept it and only truly decode it on a separate process that may even be hosted by a separate server with larger memory size. >

« previous php.internals (#118325) next »