Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88458 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 42165 invoked from network); 23 Sep 2015 21:17:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Sep 2015 21:17:29 -0000 Authentication-Results: pb1.pair.com header.from=francois@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=francois@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 212.27.42.6 as permitted sender) X-PHP-List-Original-Sender: francois@php.net X-Host-Fingerprint: 212.27.42.6 smtp6-g21.free.fr Received: from [212.27.42.6] ([212.27.42.6:12052] helo=smtp6-g21.free.fr) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 76/71-33598-8E613065 for ; Wed, 23 Sep 2015 17:17:29 -0400 Received: from [127.0.0.1] (unknown [82.232.41.54]) (Authenticated sender: flaupretre@free.fr) by smtp6-g21.free.fr (Postfix) with ESMTPSA id F0F0B82268; Wed, 23 Sep 2015 23:09:27 +0200 (CEST) To: Stig Bakken Cc: Rowan Collins , internals@lists.php.net References: <55DDD60F.5090509@gmail.com> <8C74463E-DBA2-4015-8159-0B44D973387F@craigfrancis.co.uk> <55DE0907.6040904@gmail.com> <1F615BCD-1B9B-4C51-A210-869F1AA1F6E3@craigfrancis.co.uk> <55E5EBBF.6020803@gmail.com> <0BA3A129-D356-4781-B6DE-E2B5A7924AE2@craigfrancis.co.uk> <55E6EC36.6090301@gmail.com> <9AF329EC-99A5-412D-A52B-432627A5520F@gmail.com> <6F4D91EE-B56E-4B83-B1AF-598C3F6897FC@craigfrancis.co.uk> <55F07BA4.2000204@gmail.com> <55F6B911.9080400@gmail.com> <96BE7F01-D04B-483B-B1A3-B45CED6DFCDC@craigfrancis.co.uk> <55F6F08C.1020506@gmail.com> <0BEF6D82-CB5F-49F6-A3A4-3267924A0CDA@thesba.com> <56009C96.5090504@php.net> <56013228.50504@gmail.com> <5601E01E.6080606@php.net> <56027C79.9020404@gmail.com> <5602BFB3.7090707@php.net> Message-ID: <560316E1.8070002@php.net> Date: Wed, 23 Sep 2015 23:17:21 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Antivirus: avast! (VPS 150923-1, 23/09/2015), Outbound message X-Antivirus-Status: Clean Subject: Re: [PHP-DEV] PHP 7.1 - Address PHPSadness #28? From: francois@php.net (=?UTF-8?Q?Fran=c3=a7ois_Laupretre?=) 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(). >>>> - array_key_exists() does not handle objects implementing ArrayAccess, >>> >>> >>> Sounds like something which could be fixed in array_key_exists, or >>> easily added to hasitem() without all the other baggage. >> >> Possible, yes. > > And the right thing to do. Or would you want to have to add special > cases for code depending on whether something was an object and > imlemented ArrayAccess? (There are a lot of cases where ArrayAccess > support is wanting, but that's a different issue.) I am all for adding ArrayAccess support to array_key_exists() and other functions where it is not handled. The same for property_exists() and magic methods. I'm just afraid of endless discussions about potential BC breaks :) Regards François