5
edw1o1
205d

I don’t have to be that guy, but...................

Fuck php, especially arrays and objects.

Comments
  • 1
    Objects are fine.What I don't get is why the entirety of PHP is obsessed with arrays.

    Like, wouldn't it be nice to not rewrite the same keys over and over? And not have to check is something "is set" or exits and just do shit?

    Just make a simple DTO!
  • 4
    What about arrays of objects?
  • 1
    @puradawid I prefer an object of arrays
  • 0
    Think about classic .asp

    See ya
  • 0
    @10Dev I have been thinking about but it looks more cohesive. Array of objects potentially means fuck all :-D

    Oh gosh, I miss days when we have been doing everything in Map<String, Object>. That smell of sweat and shit... Mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
  • 0
    Makes me want to learn PHP just to see if the bitching is justified 😀
  • 2
    Arrays should be completely deprecated in favor of DS. And I think they will, eventually.

    https://php.net/manual/en/...

    You can basically cover everything with Sequence , Vector and Map, and then there's Set, Stack, Queue, Deque, etc.
  • 0
    @puradawid

    $map = new Ds\Map();

    $map->put((object) [], (array) new stdClass());

    Sorry.
  • 0
    Praise the new nullsafe operators
    https://wiki.php.net/rfc/...
Add Comment