Don't let PHP be the last language you code after other languages at the end of the day.

Been staring at:
$message = "Hello " + $name;

For a whole hour trying to figure out what's wrong.

  • 4
  • 0
    Yeah, you would think it's using the '+'-operator for also string concatenation amongst summing and array merging. Especially because PHP is juggling with types a bit similar to JS, but not quite. The whole types don't matter thing would not be true if that were the case.
    '1' + 2 = 3
Add Comment