Re: [PHP-DEV] RFC Idea - is_json - looking for feedback

2022-07-31 Thread Jordan LeDoux
On Sun, Jul 31, 2022 at 11:23 AM juan carlos morales < dev.juan.mora...@gmail.com> wrote: > - Benchmark including memory_get_peak_usage - > > # json_decode() > > Megas used before call: 79.23828125 > PEAK Megas used before call: 128.00390625 //< > Megas used after call: 3269.23828125 >

Re: [PHP-DEV] RFC Idea - is_json - looking for feedback

2022-07-31 Thread Juan Basso
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($p

Re: [PHP-DEV] Negative values in PcgOneseq128XslRr64::jump($advance)

2022-07-31 Thread Anton Smirnov
On Sun, 2022-07-31 at 19:52 +0200, Tim Düsterhus wrote: > Hi > > On 7/31/22 17:50, Anton Smirnov wrote: > > I'm writing a polyfill for ext-random and I noticed a small > > weirdness. > > PcgOneseq128XslRr64::jump() accepts negative $advance where it > > automagically becomes unsigned positive. >

Re: [PHP-DEV] RFC Idea - is_json - looking for feedback

2022-07-31 Thread juan carlos morales
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 o

Re: [PHP-DEV] RFC Idea - is_json - looking for feedback

2022-07-31 Thread juan carlos morales
(I received an email from mailer-dae...@lists.php.net , I had to cut the message history as the mail server complained because the email got too long) Larry, here is the same benchmark including memory_get_peak_usage as requested (more after the benchmark) - Benchmark including memory_get_pe

Re: [PHP-DEV] Negative values in PcgOneseq128XslRr64::jump($advance)

2022-07-31 Thread Tim Düsterhus
Hi On 7/31/22 17:50, Anton Smirnov wrote: I'm writing a polyfill for ext-random and I noticed a small weirdness. PcgOneseq128XslRr64::jump() accepts negative $advance where it automagically becomes unsigned positive. Yes, this is what happens when casting a negative signed integer to an unsig

Re: [PHP-DEV] PHP 8.2.0 Beta 1 available for testing

2022-07-31 Thread shinji igarashi
Hello internals, > 8.2.0beta2 should be expected in 2 weeks, i.e. on August 4th 2022. The release of 8.2.0beta2 is imminent, but the PR for trait constants has not yet received enough review and of course has not yet been merged. https://github.com/php/php-src/pull/ I am not sure if this wil

[PHP-DEV] Negative values in PcgOneseq128XslRr64::jump($advance)

2022-07-31 Thread Anton Smirnov
Hi! I'm writing a polyfill for ext-random and I noticed a small weirdness. PcgOneseq128XslRr64::jump() accepts negative $advance where it automagically becomes unsigned positive. Does it make sense or maybe it's better to throw a ValueError there? -- Anton -- PHP Internals - PHP Runtime Develop

Re: [PHP-DEV] RFC Idea - is_json - looking for feedback

2022-07-31 Thread Larry Garfield
On Sun, Jul 31, 2022, at 8:14 AM, juan carlos morales wrote: > Before starting, I want to thank all for taking time from your time, to > give me a feedback, I sincerely respect that, so ... thanks! > > Sorry for the long message, but I have the feeling that ... this is it, is > now ... or it will

Re: [PHP-DEV] RFC Idea - is_json - looking for feedback

2022-07-31 Thread juan carlos morales
El dom, 31 jul 2022 a las 0:56, Deleu () escribió: > > > On Sat, Jul 30, 2022, 4:48 PM David Gebler 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