I need to solve a problem like below. I’m not sure, can you suggest better method?
switch(true){
case $price>100:
tooHigh();
break;
case (($price<=100) && ($price>70)):
negotiate();
break;
case (($price<=70) && ($price>20)):
accept();
break;
case ($price<=20):
thankAndEscape();
break;
}
Try it and post the results/your impressions (information about performances are appreciated 🙂
Cheers!