François Laupretre wrote on 23/09/2015 22:17:
Le 23/09/2015 18:37, Stig Bakken a écrit :
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.
I don't say it's more readable than isset(), I say that's more
readable than array_key_exists().
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]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php