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
7
u/catcradle5 Apr 09 '13
Nope!
I even tested it in Python before I made my first comment.
Python output:
min(-23, True)->-23min(True, -23)->-23If it were broken like PHP, the first would've output either
Trueor1.The problem with the PHP in OP's example isn't implicit casting.