Casting to `object` has not been necessary for me before. Are there situations where `json_encode()` behaves unpredictably?