Comment by dehrmann
3 days ago
One place I worked, customers (usually merchants) sent product data through an API my team managed. I was working on a data validation project and ran across an item that was getting rejected. One of the fields customers can set is tags. The item was a t-shirt with a joke about null pointer exceptions, so someone set tags to include ["null", "pointer", "exception"]. Our parser coerced it to null, then returned an error because that array can't contain nulls.
Ah yes, automatic type coercion. A literal “WTF were you thinking” feature of JavaScript. So much pain for so little gain.
When it comes to implicit type conversion, JS has nothing on PHP.