That was one careful developer

  • 41
    I feel like this developer has seen some shit.
  • 6
    This is a nice example where 1TBS would have been superior (I imagine removing braces altogether is impossible).
  • 16
    Why is that one Null in all caps? And why not just iterate over args?
  • 3
    @port22 I guess because diversity is what makes the world go 'round?
  • 4
    @StefanH That's really cool! Maybe he was trying to prevent malicious bits injected between the opening of the function and the first if statement 😃
  • 1
    @StefanH Interesting, just read something about this happening in linux, the dirty COW exploit. Seems like this kind of attack.
  • 1
    You need to get used to === or !== instead of == and !=. And simply check the type you comparing. The code here might still not work if value is empty string or undeclared.
  • 1
    Are we ignoring the fact that 2 difference cases were used for the argument defaults? NULL and null...
Add Comment