> Le 27 mars 2019 à 14:29, Benjamin Morel <benjamin.mo...@gmail.com> a écrit : > > Thinking about this a bit more, what about following JavaScript semantics? I > find them really good in this respect: >
Arithmetic in JavaScript cannot be used reliably (in general) without converting your data to the proper type, because 1 + 1 gives you 11 if one of the 1s is encoded as string. PHP does a better job in that respect. As a result, there is good chance that people (it is at least the case for me) are more confident to rely (often implicitly) on automatic type conversion between strings and numbers when doing basic arithmetic in PHP than in JS, including for comparison of numeric values. About leading/trailing whitespaces: usually, numbers encoded as strings do not contain them; so that it may be OK to consider strings containing them as non-numeric if we want. —Claude -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php