Is it possible to add elements to stdclasses like we do for arrays?
Array (
[0] => item 1
[1] => item 2
)
Stdclass (
[0] => item 1
[1] => item 2
)
Is it generally harder to manipulate objects as compared to arrays? Since we have lots of array functions to make use of etc.
Sure, you can add new elements…
If you want to iterate object as array you should use PHP SPL ArrayIterator or RecursiveArrayIterator.
Also you can use typecasting to move from array to object and back…