I\'m building classes that interface with the Twitter API, and I\'m wondering whether PHP\'s built-in XML or JSON parser is faster? Twitter will send me the same data in eit
I tend to find that simplexml_load_string() is faster than json_decode() when the json return is an object.
However, having the json returned as an array using json_decode($string, true) is actually a lot faster than using an object (as is true with most things PHP when comparing arrays to objects).
Ive seen json_decode() being over twice as fast as simplexml_load_string() under these circumstances.