From:             zabmilenko at charter dot net
Operating system: Any
PHP version:      5.1.2
PHP Bug Type:     Feature/Change Request
Bug description:  minmax(...) == min($max, max($min, $val))

Description:
------------
I find myself reusing the following code to adjust numbers into a desired
range and precision:

$val = min($max, max($min, round($val, $prec));

This could be more elegantly written like:

$val = minmax($val, $min, $max[, $prec]);


In my opinion.

Thank you.


-- 
Edit bug report at http://bugs.php.net/?id=36871&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=36871&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): 
http://bugs.php.net/fix.php?id=36871&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=36871&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=36871&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=36871&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=36871&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=36871&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=36871&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=36871&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=36871&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=36871&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=36871&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=36871&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=36871&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=36871&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=36871&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=36871&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=36871&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=36871&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=36871&r=mysqlcfg

Reply via email to