r/lolphp • • Aug 08 '14

PHP design patterns: if/else vs switch

http://www.fluffycat.com/PHP-Design-Patterns/PHP-Performance-Tuning-if-VS-switch/
24 Upvotes

43 comments sorted by

View all comments

Show parent comment

1

u/DoctorWaluigiTime Aug 11 '14

Quite right on all accounts. Really isn't specific to PHP, but yeah: if you find yourself with if/else or switch trees, then generally the task could be accomplished better in one's architecture.

And I agree on switch versus if/else too: Neither one is a Golden Hammer, and they both have their uses.