That's about all I need to ask. Checked the PHP manual and saw a user post saying that serialize is 45-90% slower than json_encode (he ran some benchmarks). But how "slow" is slow? I can find a lot of "versus" stuff sprawling around but none of which a beginner like me can relate to.
I just wrote a script that encoded an array in json and another one to decode it. I did same with serialize. Obviuously that won't tell me any significant differences between them.
Do that 10,000 times (each) to (hopefully) get a measurable idea of differences in both memory usage and CPU time.
Mostly the difference won't be significant in terms of performance. Using JSON is useful in two particular circumstances: for returning to a Web browser and for interoperability with other applications (via Web services and other means), particularly those on non-PHP platforms.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With