PHP object to json converter