Selection: Branching logic — if/else, switch — choosing which block runs based on a condition. Selection is one of the three basic building blocks of structured programming, together with sequence and iteration. It means choosing which code to run based on a condition, using if, else, switch or match. Every business rule ends up as selection somewhere: free shipping above a certain amount, a different VAT rate for a country, access only for admins.
Keep conditions readable. Name complex conditions with a variable or method, such as $order->qualifiesForFreeShipping(), and return early to avoid deep nesting. When the same switch on a type appears in several places, polymorphism or a lookup table is usually cleaner. PHP's match expression is stricter and shorter than switch for mapping values, and it throws an error when no case matches.
Implement proven backend architecture patterns including Clean Architecture, Hexagonal Architecture, and Domain-Driven Design. Use this skill when designing clean architecture for a new microservice, when refactoring a monolith to use bounded contexts, when implementing hexagonal or onion architecture patterns, or when debugging dependency cycles between application layers.