No matter how often I remind myself that s/// does not return the string, my fingers still type the code as if it does.
This problem becomes even more notorious, when you have to use PHP once in a while, and you get used to the familiar behavior of preg_replace. preg_replace does exactly what you wrote, that is, it returns the replaced string. I know, it has come up before many times here, but for me that PHP-ish behavior is much more natural. This does not generalize to PHP itself, though...
rg0now
In reply to Re: Stupid mistakes I repeatedly make
by rg0now
in thread Stupid mistakes I repeatedly make
by brian_d_foy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |