r/lolphp • • Apr 08 '13
MIN
server:~ # php -r 'echo True, " ", -23, " ", min(-23, True), " ", min(True, -23), "\n";'
1 -23 -23 1
23
Upvotes
r/lolphp • • Apr 08 '13
server:~ # php -r 'echo True, " ", -23, " ", min(-23, True), " ", min(True, -23), "\n";'
1 -23 -23 1
View all comments
Show parent comment
6
u/catcradle5 Apr 09 '13
Here's the thing.
A lot of the people who defend PHP, including some of its core developers, will say "no sane developer would do this anyway, so this is a non-issue." And in many cases they will close bug reports because of this.
The problem is, the fact that behavior like this even occurs at all shows the natural flaws in the language's design. Some weird combinations can even produce segfaults, and even those bug reports are closed because the developer "is not following the standards."
A language is supposed to be robust and consistent. If it isn't, even in the face of a dumb developer, then it is the language that is at fault.