74
linuxxx
7y

I just spent an hour debugging as to why a fucking json_decode STILL PRODUCED OBJECTS.
.
.
.
.
.
Oh right, I need to set a second parameter as true.

😐

Comments
  • 8
    welcome to php :D
  • 1
    Oh I remember the time I made that mistake very often.
  • 0
    Don’t be someone I almost slapped once who would rather then add TRUE would run the object through an recursion function to produce the array “because it was better”🤦‍♂️
  • 7
    @C0D4 WHY WOULD YOU DO THAT IF YOU COULD ADD THE FUCKING TRUE PARAMETER?!
  • 2
    @linuxxx haha I know right!
    I gave up trying to understand and just removed it on the next commit 😂

    Sometimes I think the easy way is intimidating to some people.
  • 2
    Or parsing a JSON 'string' in JavaScript that's already been parsed and wondering wtf is wrong for an hour.

    Efffff that and thank you baby Jesus for being born in a couple days, I'm now broke and yes I will build your WP site for $2/hr
  • 0
    I've done that before.
  • 1
    Nothing beats "=" instead of "=="
  • 0
    PHP is dumb.
  • 1
    @juunas Nah it's awesome imo. I just completely forgot that parameter.
  • 0
    @linuxxx Can you explain how having to check if an error occurred during decoding through a separate function when the language supports exceptions is awesome?
  • 0
    @juunas I got very clear error messages, it was just related to my own errors rather than PHP's ones. The function I called in the way I did was perfectly valid even without that parameter, I just forgot that the parameter was needed to get an array instead of an object.
Add Comment