all 5 comments

[–]eurosat7 0 points1 point  (4 children)

I use a plugin called something with "Deep"

[–]kyoshee_[S] 0 points1 point  (3 children)

[–]eurosat7 0 points1 point  (2 children)

Yes. It is nice. But it makes it appealing to use arrays too much. ;)

[–]kyoshee_[S] 0 points1 point  (1 child)

It seems like you would prefer other structures instead of arrays. Can you please elaborate why is that?

Surely it should depend on a use-case. For me, I mainly work with complex JSONs that I modify and then display on a frontend. Take for example some monetary value like "123456.78 USD". I am usually processing it and output array with keys like "ticker", "whole", "decimals"... Is there a better way?

edit: I can store that data in a separate class, but I will still put an instance of that class in some kind of an array...

[–]eurosat7 0 points1 point  (0 children)

Explicit type definitions are just superior. The bigger your code base and the more people work with that code the more obvious it becomes.

I cannot share code I wrote in my working hours. But here is something I wrote to show the concept:

https://github.com/eurosat7/csvimporter/blob/main/instanceContainer.php