ID: 30845 Comment by: jed at jed dot bz Reported By: phpbugs at eire dot ca Status: Open Bug Type: Feature/Change Request Operating System: FreeBSD PHP Version: 5.0.2 New Comment:
The ellipsis operator is unnecessary due to the existence of the range() function. true == 5 in range(1, 10); The in operator, in my opinion, is unnecessary and is only syntactic sugar due to the existence of in_array(). I don't like S.S. operators (I opposed instanceof et. al., as well as "and" as an alternative to &&). In the long run, syntactic sugar makes code more difficult to read and just adds more passes in the parser. PHP at its root isn't BASIC. It's nice functionality, I agree, but there's a lot more that could be done to the language to make it more like VB. And that's not a good path to start down. Previous Comments: ------------------------------------------------------------------------ [2004-11-19 22:29:03] phpbugs at eire dot ca 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 this bug report at http://bugs.php.net/?id=30845&edit=1