Re: [PHP-DEV] array_merge() vs array unpacking performance

2022-08-01 Thread David Rodrigues
> There are already a number of optimizations in array_merge. It might depend on the actual test data that you used. Maybe a specific path needs to be optimized. Please provide some more details. You are right. I do not know how I tested before, but actually, array_merge() is bit faster than array

Re: [PHP-DEV] array_merge() vs array unpacking performance

2022-08-01 Thread Kamil Tekiela
Hi David, It would be useful if you could provide your measurements and the way you arrived at such results. A quick test doesn't seem to support your findings: https://3v4l.org/v5m9f#v8.1.8 There are already a number of optimizations in array_merge. It might depend on the actual test data that y

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

2022-08-01 Thread David Gebler
On Sun, Jul 31, 2022 at 4:41 PM Larry Garfield wrote: > So the core argument, it seems, is "there's lots of user-space > implementations already, hence demand, and it would be > better/faster/stronger/we-have-the-technology to do it in C." > There's innumerable features implemented in userland w

Re: [PHP-DEV] What type of Exception to use for unserialize() failure?

2022-08-01 Thread Tim Düsterhus
Hi On 8/1/22 14:58, G. P. B. wrote: During review cmb noted that using an 'Error' here might not be the best choice, as while it is likely to be a programmer error if unserializing fails, we do not want to educate users to catch(Error). I probably have a very different philosophy on this as I

[PHP-DEV] array_merge() vs array unpacking performance

2022-08-01 Thread David Rodrigues
Hello! PHP 8.1 supports array unpacking with keys. I guess that is very similar to array_merge(), but for some reason array_merge() is 50% slower than unpacking. So my question is: is there some way to optimize the engine so array_merge() can work like unpacking? Thanks!

Re: [PHP-DEV] What type of Exception to use for unserialize() failure?

2022-08-01 Thread G. P. B.
On Fri, 29 Jul 2022 at 18:17, Tim Düsterhus wrote: > Hi! > > I'm currently in the process of cleaning up the error handling of the > new ext/random and now came across the implementation of __unserialize(). > > Looking through the source code for existing examples I found that the > following is