New! PHP:CSI - To Switch, Or Not To Swit ...

New! PHP:CSI - To Switch, Or Not To Switch?

Sep 11, 2022

I was writing unit tests for a API mapping function recently and came across this interesting issue. The code I was writing tests for was in a legacy codebase that I was making changes to, and it made sense to have some unit tests in there before I started work to ensure everything worked before and after.

The mapping function in question would take a value as input and return another value as the output. The code seemed like it should work, but then applying certain values to the mapping function it would produce an incorrect result.

Read more here: https://www.hashbangcode.com/article/phpcsi-switch-or-not-switch

Enjoy this post?

Buy !# code (Hash Bang Code) a coffee

More from !# code (Hash Bang Code)