Re: PHP 7.1 - Address PHPSadness #28?
| From: | Rowan Collins | Date: | Wed, 16 Sep 2015 13:30:42 +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-88240@lists.php.net to get a copy of this message | ||
François Laupretre wrote on 16/09/2015 14:26:
OK, but, as I already said, an exists() construct would probably be used mostly for arrays elements and properties. Can't we accept this as a more readable alternative to array_key_exists()/property_exists() ?Yes, we can, and I repeatedly have. With the caveat that, like Perl, we raise an error if you try to use it on a plain variable rather than an array key or object property reference. My only remaining concern is that with that error in place, is "exists" the right name, and if not, what would be better? Regards, -- Rowan Collins [IMSoP]