(Sorry for double reply, hit send too soon) On 14/06/2022 12:18, Arnaud Le Blanc wrote:
Your example uses isset(), which is valid code in most circumstances, but as you said it's not particularly good code. Do you have other examples that come to mind ?
There is plenty of code out there in the real world that is not particularly good, so I think it's a realistic example to think about.
The question is, do we think the language can and should help people avoid that mistake?
- Would the explicitness of "use(...)" make it more likely someone would spot it? - Would people be more likely to write "let $guest=..." (or whatever block-scope keyword we choose) than add "$guest = null;" at the beginning of the closure?
I'm not totally sure, but we should always consider the impact on less-expert users, not just the power-users who are the ones often asking for new features.
Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php