hristonev / sportmonks-client-bundle

Easily talk to an SportMonks API in PHP
MIT License
14 stars 7 forks source link

Is there a reason data held as stdClass Object and not array #16

Open QES opened 5 years ago

QES commented 5 years ago

I was wondering if there was a reason that the retrieved data is held as a stdClass Object rather than as an array?

Obviously the simplest solution is to manipulate it is json/encode/decode to return an array.

$array = json_decode(json_encode($object), True);

However, I wondered if there was a particular reason for this form that I don't yet understand, and if not if there could be a way to flag the code to return an array rather than a stdClass Object?

hristonev commented 5 years ago

-> is less than ['']. I'm lazy.