From: phpbugs at eire dot ca
Operating system: FreeBSD
PHP version: 5.0.2
PHP Bug Type: Feature/Change Request
Bug description: add "in" operator to test for inclusion
Description:
------------
Some languages such as SQL or (cough)Visual Basic(cough) include an "in"
operator to test for inclusion in a given range of values.
SQL uses an explicit list of values like so:
SELECT s1 FROM t1 WHERE s1 IN (SELECT s1 FROM t2);
Or an even simpler example:
SELECT 'foo' IN ('foo','bar','foobar');
Visual Basic makes it even better by adding the ellipsis operator:
if iBar in (25..40) then
This would be a great addition to PHP, with or without the ellipsis
operator. It would be especially useful for switch statements. And if
you could pass it an array, I'd be in heaven!
--
Edit bug report at http://bugs.php.net/?id=30845&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30845&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=30845&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=30845&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=30845&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=30845&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=30845&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=30845&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=30845&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=30845&r=support
Expected behavior: http://bugs.php.net/fix.php?id=30845&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=30845&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=30845&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=30845&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30845&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=30845&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=30845&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=30845&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=30845&r=float
MySQL Configuration Error: http://bugs.php.net/fix.php?id=30845&r=mysqlcfg