ID:               36232
 User updated by:  na at index20 dot ru
 Reported By:      na at index20 dot ru
-Status:           Open
+Status:           Bogus
 Bug Type:         Unknown/Other Function
 Operating System: All
 PHP Version:      5.1.2
 New Comment:

min(true, 1, 0, -2) == min(min(min(true,1),0),-2) ==
min(min(true,0),-2) == min(0,-2) == -2;
min(true, 1, -2)    == min(min(true,1), -2) == min(true, -2) == true;
min(true, 1, -2, 0) == min(min(min(true,1),-2),0) == min(min(true, -2),
0) == min(true, 0) == 0;
min(-2, 1, 0, true) == min(min(min(-2,1),0),true) == min(min(-2, 0),
true) == min(-2, true) == -2;

just another one weak type gotcha...


Previous Comments:
------------------------------------------------------------------------

[2006-01-31 17:27:52] na at index20 dot ru

Description:
------------
min() works abit weird...
Tested on 4.4.1, 5.1.1

Reproduce code:
---------------
var_dump(min(true, 1, -2));
var_dump(min(true, 1, 0, -2));
var_dump(min(true, 1, -2, 0));


Expected result:
----------------
-2
-2
-2

Actual result:
--------------
true
-2
0


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=36232&edit=1

Reply via email to