18 ms·
`switch (true)` is insane, but it does actually work as the author intended it to in PHP. It just evaluates each of the case statements in order until one evalu
by plorkyeran 9y ago
`switch (true)` is insane, but it does actually work as the author intended it to in PHP. It just evaluates each of the case statements in order until one evaluates to true, so it's equivalent to an if/else chain.