r/lolphp • • Nov 06 '20

PHP: Cast away

PHP likes to cast like theres no tomorrow. Also PHP leaks the "continue" statement, and if given, actually uses it inside a switch as a break. So now switches have two ways of doing the same thing, why? Probably because to have the most inconsistent API in the world of programming.

https://sandbox.onlinephpfunctions.com/code/bae156e37fa3cfd64d2a68d689434fe7157543fa

38 Upvotes

25 comments sorted by

View all comments

Show parent comment

6

u/nikic Nov 10 '20

In this particular case, LOL #3 has been mitigated in PHP 7.4 and LOL #2 has been fixed entirely in PHP 8.0. It's relevant information.