4 ms·
$foo++ isn't an exception. It has documented behavior on strings. That is sometimes very useful.
by btilly 15y ago
$foo++ isn't an exception. It has documented behavior on strings. That is sometimes very useful.
- rjh29 15y agoI meant it's an exception because it does not throw a warning, even though you are treating a string as a number. (This is contrary to $foo = $foo + 1). The DWIM string auto-increment doesn't even kick in unless the variable matches /^[a-z]/i.