Re: PHP 7.1 - Address PHPSadness #28?
| From: | Rowan Collins | Date: | Thu, 24 Sep 2015 10:06:28 +0000 |
| Subject: | Re: PHP 7.1 - Address PHPSadness #28? | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-88471@lists.php.net to get a copy of this message | ||
François Laupretre wrote on 23/09/2015 22:17:
Le 23/09/2015 18:37, Stig Bakken a écrit :To be pedantic, you actually did say that, in the text quoted above: "replacing calls to isset() ... with exists() ... can only improve overall readability". Regardless, Stig's point stands, that exists() is a very general name, and the proposed function definition is also very all-inclusive, leading to the risk of hard-to-understand code. Regards, -- Rowan Collins [IMSoP]I don't say it's more readable than isset(), I say that's more readable than array_key_exists().If they start replacing calls to isset()/array_key_exists() with exists(), that's their choice and it can only improve overall readability.The thing is, it won't really improve overall readability, because the name exists() is still too vague. It may be obvious to the person who wrote the code (at least for the first two weeks), then you're really back into the same vagueness that isset() provides.