RE: [PHP-DEV] Feature request for min() and max()
| From: | Colin Viebrock | Date: | Mon, 20 Nov 2000 15:54:27 +0000 |
| Subject: | RE: [PHP-DEV] Feature request for min() and max() | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-38620@lists.php.net to get a copy of this message | ||
> I don't think that's a very good idea. If the user gives the min()
> function an invalid value, he should get an error.
Well, my point I suppose is whether giving one value is really invalid.
For instance, I am perhaps reading data from a log file, or from some
other outside source where I have no idea going in how many values I
am going to get. To then pass this data to min() or max(), without
doing a if...else loop in *my* code (knowing that PHP will do the right
thing) would be a lot nicer, IMHO.
Yes, I could recode my scripts. But it seems intuitive to me to just
do this.
> Anyway, the easiest way to this would simply be to change:
<snip>
> Adding an if .. else is really kind-of unneccessary.
Okay ... that's why I posted the code to the list first before committing.
- Colin