Highlights a lot of the key features of Laravel (I learnt a lot here!) and also a lot of the flaws of PHP and ways to work around them (e.g. lack of native enums!).
I think it's worth noting that, when optimising for readability rather than "cleverness", generally it's best to avoid things like "variable variables" as they just confuse things and there's normally a way to write the same thing in a less confusing manner :) Just because one can do things like that, doesn't mean one should!
I think the "variable variables" thing is more like a trick question I've never seen somebody use this kinda thing and if somebody did I'd assume they are overcomplicating something
Nice overview :)
Highlights a lot of the key features of Laravel (I learnt a lot here!) and also a lot of the flaws of PHP and ways to work around them (e.g. lack of native enums!).
I think it's worth noting that, when optimising for readability rather than "cleverness", generally it's best to avoid things like "variable variables" as they just confuse things and there's normally a way to write the same thing in a less confusing manner :) Just because one can do things like that, doesn't mean one should!
I think the "variable variables" thing is more like a trick question I've never seen somebody use this kinda thing and if somebody did I'd assume they are overcomplicating something
Yes exactly - treat it as a code smell.