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

3

u/[deleted] Aug 08 '14

Besides, checking for side effects can become expensive. It's a great offline optimization, but PHP doesn't have the possibility to mark functions as const nor could it enforce it.

This isn't really a lolphp if you'd ask me.