3 ms·
In the same way that projects enforce a certain subsection of c++, it is probably best in PHP to not code anything in a way that relies on unusual quirks of the
by robryan 14y ago
In the same way that projects enforce a certain subsection of c++, it is probably best in PHP to not code anything in a way that relies on unusual quirks of the language to work. None of my code gets bitten here because I never passed number_format anything but numbers.
- andreasvc 14y agoIn my opinion weak typing is an unusual quirk, but there's no way to get around that. I really wonder kind of reasons could be given to defend it; I don't think a strongly typed language like Python is any harder because of its types.
- robryan 14y agoI tend to agree, these days where possible when working in PHP I try not to rely on PHPs magic type conversions behind the scenes for things like comparisons.
- andreasvc 14y agoYou can't really avoid weak typing; e.g., making a mistake in a strongly typed language would raise an error, whereas in a weakly typed language it can silently screw up everything.