2012/7/24 Andrew Faulds <
[email protected]>:
But PHP functions usually have side-effects, they aren't strict mathematical
functions.
Ah, you might mean str_tok()? Are there more, do you have a list?
But we're in PHP-programming-context. You write a function in PHP, you
call it and it will return once called. I see there no exeption.
So complaining about this is rather pointless.
I don't complain about the past. I just think now, that if it doesn't
behave like a function it shouldn't be called function. A function
which returns as an object and is not completed is not a function.
And if other languages do so, my argument will be the same.
<rising finger with epic mimic, fistulous voice> We need not to make
the same mistake again! :)
All the array_* functions have side effects. Most class methods, which are also functions, have side effects. Most of the functions I write have side effects. Much of mysql_* has side effects.
PHP is not LISP.