Switch is for equality comparison only, not for greater than / less than
No less than or greater than statements allowed in switch statements?
Apparently not.
comparison operator in switch statement
WRONG! - this syntax caused a parse error
switch ($value) {
case '<20':
return 1;
case <100:
return 5;
case <200;
return 10;
case <500;
return 20;
case <2000;
return 50;
default:
return 100;
}Again, the above is BAD. It causes this:
Parse error: syntax error, unexpected '<' in /home/zingspac/public_html/auction2007/modules/contributed/ecommerce/contrib/zing_auction/zing_auction.module on line 107
I don't think there's any way that this is allowed in a switch statement:
http://us.php.net/manual/en/control-structures.switch.php
That's sad.
Is there tricker syntax of which Agaric is not aware?
(For the record, Agaric replaced this switch or if/else idea with an elegant one-line function that divides an item's estimated value by an administrator-chosen factor and rounds up with ciel(), for our latest, greatest Zing Auction Module).

You were close but yes that syntax is not correct. Technically you want your switch statement to process for all things TRUE.
switch (TRUE) {
case ($value < 20 ): return 1;
case ($value < 100): return 5;
case ($value < 200): return 10;
case ($value < 500): return 20;
case ($value < 2000): return 50;
default: return 100;
}
So at each case the expression is $value less than 'whatever' will be tested and return either TRUE or FALSE. Therefore your switch statement will be comparing TRUE to TRUE or TRUE to FALSE. I'd imagine that you're
using this similar to an IF/ELSE, so you shouldn't need a break statement.