• dan@upvote.au
    link
    fedilink
    arrow-up
    2
    ·
    1 年前

    stdClass is for objects. I’m talking about maps. I guess you could use stdClass for maps too, but that feels weird.

    • xmunk@sh.itjust.works
      link
      fedilink
      arrow-up
      1
      ·
      1 年前

      If you read the docs for json_decode, the default behavior is to operate with stdClass - I too prefer working with associative arrays because of their power but… that kind of just reinforces how useful they are. PHP can give you the full Java class system if you want… it’s just a pain and useless in most circumstances so we all just toss around associative arrays.