PHP 4.0 Bug #8953: in_array returning number of 'hits'
| From: | melvyn at idg dot nl | Date: | Sat, 27 Jan 2001 20:16:25 +0000 |
| Subject: | PHP 4.0 Bug #8953: in_array returning number of 'hits' | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-45152@lists.php.net to get a copy of this message | ||
From: melvyn@idg.nl
Operating system: any
PHP version: 4.0.4pl1
PHP Bug Type: Feature/Change Request
Bug description: in_array returning number of 'hits'
I'd like to see in_array returning the number of values matching, instead of just true/false.
IMHO, it would not create any backwards compatibility problems, since 0 equals false anyway and >
0 equals true.
It would make constructing dual-parameter descisions much easier.
For example - a bounce script, where "bounce_count / day" > 6 AND "bounces
/week" = 5.
This is very hard to do now, but with in_array returning the number of hits, it takes out at least 2
loops and a seperate "counts" array.
--
Edit Bug report at: http://bugs.php.net/?id=8953&edit=1