2 ms·
if you wanted a PHP object to use dot notation, then you'd have to change the string concat operator to something else. So you mention the "+" symbol, but then
by dylan604 2y ago
if you wanted a PHP object to use dot notation, then you'd have to change the string concat operator to something else. So you mention the "+" symbol, but then you confuse addition with concat and then you've just introduced JS issues into PHP.
- adamtaylor_13 2y agoI’ve used JS my entire professional career and never once had to worry about whether I was performing string concatenation or addition. Besides, you probably access objects 10x more often than you concatenate strings manually. Way more often that I’m doing some sort of string split, filter, join.
- jt2190 2y ago> I’ve used JS my entire professional career… Doesn’t JS have => ? Isn’t that -> plus an extra key press? (Shift?)
- adamtaylor_13 2y agoYes, used much less than object property access.
- dylan604 2y agocome on, really? you've never done a = '1'; b = '2'; let sum = a + b so that sum is '12'? it happens all the time when reading from the DOM and you fail to parseInt/parseFloat.