Hacker News new | ask | show | jobs
by withinboredom 744 days ago
> Go has typed container types while PHP has not.

I suggest looking at https://github.com/Crell/Serde, if that is a requirement in PHP.

> PHP is more convenient at another common case which is heterogeneous maps.

Or arbitrary, user-defined keys...

> If you want/need to walk through it in a single pass fashion, then Go is definitely more fitting.

array_map, array_reduce, array_column is pretty good at walking through arrays very quickly, assuming you parsed the json into arrays instead of objects.

1 comments

Go has builtin typed container types while PHP has not.