On 26/10/2020 09:02, Andreas Bittner wrote:
With regards to the JSON looking different when casting to object:
```
json_encode([1,2,3]); // result: [1,2,3]
json_encode((object)[1,2,3]); // result: {"0":1,"1":2,"2":3}
json_encode([]); // result: []
json_encode((object)[]); // result: {}
Than
I don't follow; is the resulting JSON different if you cast to
object, or is there some other reason you prefer an object over using
an associative array directly?
The by-reference semantics of objects vs arrays in PHP.
*shrug* If you want things to be mutable between functions, stick an & in
On 23 October 2020 21:14:49 BST, Mike Schinkel wrote:
>> On Oct 23, 2020, at 2:33 PM, Rowan Tommins
>wrote:
>>
>> I don't follow; is the resulting JSON different if you cast to
>object, or is there some other reason you prefer an object over using
>an associative array directly?
>
>The by-refere
> On Oct 23, 2020, at 2:33 PM, Rowan Tommins wrote:
>
> I don't follow; is the resulting JSON different if you cast to object, or is
> there some other reason you prefer an object over using an associative array
> directly?
The by-reference semantics of objects vs arrays in PHP.
> Also, to cl