PHP interview warm-up
PHP 8 comparisons, references, array keys, enums and the array/string functions you'll be asked to use.
- PHP 8 String-to-Number Comparison How `==` changed in PHP 8 and why numeric strings still compare as numbers.
- foreach by Reference Leftover A dangling reference after `foreach (... as &$item)` corrupts the next loop.
- Array Key Casting Which keys PHP silently converts to integers.
- Leaderboard Sorting with usort and <=> Sort associative arrays by several keys using the spaceship operator.
- Slugify a Title (Strings & Regex) Turn a title into a URL slug with a maximum length that doesn't cut words.
- Order Status Enum with Transitions Use a PHP 8.1 backed enum with methods to enforce valid state changes.
- Revenue Report from CSV Parse a CSV export, skip bad rows and total paid revenue per region.
- Two Sum Find the indices of the two numbers that add up to a target.
- LRU Cache A fixed-capacity cache that evicts the least recently used key, with O(1) get and put.